Unix time puzzle / confusion

I am getting very confused here. I need unit time to pass to openssl. THis works fine on the server as teh time is already UTC. My PC is Brisbane time. But I cant seem to get both working.

    UTC_Now := TTimeZone.Local.ToUniversalTime(Now);
    Current_Time1 := DateTimeToUnix (UTC_Now, False);
    Current_Time2 := DateTimeToUnix (Now) - (10*3600);

UTC_Now (presumably UTC) is 27/11/2025 03:43:03
1 returns 1764178983
2 returns 1764214983

Maybe my calculation is wrong as well as I was expecting 1764218583

DateTimeToUnix (UTC_Now, False);

The second parameter for DateTimeToUnix is: AInputIsUTC. You have False, but the input value is UTC.

DateTimeToUnix (Now) - (10*3600);

If the code is running on a machine that is not UTC, this call needs to have a second parameter of False.

Thanks Dave. The problem is that I was trying to use the same code for both the server on UTC and my PC on Brisbane times. And I dont really want to toggle that flag - it just makes the code different. And it would fail if the server timezone changed. I want the OS to sort it out.

I think I know how to fix it now. I was trying to use FCM for Notifications and it fails on one and works on the other. Finally narrowed it down to the time.

For everyone else to laugh - I asked Claude. After it gave me several silly answers, I realised that it’s clock is 27 May 2024. And it insists that my clock is wrong which is why I am getting incorrect results.:rofl: