-1

This is related to this post. The Unix Epoch timestamp 1687303606 equates to 2023-06-20 23:26:46 UTC. I want to output it in my local time, UTC-4 or Eastern Daylight Saving Time (EDT). In SQLite3 if I do :

select datetime(1687303606, 'unixepoch', 'localtime')

it still outputs 2023-06-20 23:26:46, not 2023-06-20 19:26:46. FYI:

$ sqlite3 --version
3.42.0 2023-05-16 12:36:15 831d0fb2836b71c9bc51067c49fee4b8f18047814f2ff22d817d25195cf350b0

$ date
Tue Jun 20 19:58:06 EDT 2023
user4157124
  • 2,809
  • 13
  • 27
  • 42
  • It works for me. Are you sure the machine you are testing on has a local time setting different from UTC? – Andrea B. Jun 21 '23 at 13:23
  • That's why I included the output of the date command in my post. It shows the local time in EDT (Eastern Daylight Time). – user9968388 Jun 21 '23 at 15:16

1 Answers1

0

According to this thread, your problem probably lies in your OS implementation of time zones (the thread is about cygwin but it could be an issue on other OS).

Try to unset the TZ environment variable.

Andrea B.
  • 659
  • 4
  • 9