Message Boards Message Boards

GROUPS:

How to Convert Date-Times using Prevailing Timezones

Posted 12 days ago
186 Views
|
2 Replies
|
5 Total Likes
|

POSTED BY: Dave Middleton
2 Replies
Posted 12 days ago

I think a better approach would be to use the built-in timezone-related functions. For example, using your Unix moment of 1652439989, we can find the timezone offset at that moment:

TimeZoneOffset["America/Chicago", "GMT", FromUnixTime[1652439989]]
(* -5. *)

You can convert to that offset:

TimeZoneConvert[FromUnixTime[1652439989], TimeZoneOffset["America/Chicago", "GMT", FromUnixTime[1652439989]]]

You can also just do this with an option in FromUnixTime:

FromUnixTime[1652439989, TimeZone -> TimeZoneOffset["America/Chicago", "GMT", FromUnixTime[1652439989]]]
POSTED BY: Eric Rimbey
Posted 12 days ago

Thank you Eric, this is the function to use to convert dates with prevailing timezone (offset). Problem solved.

POSTED BY: Dave Middleton
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract