Message Boards Message Boards

1
|
3353 Views
|
2 Replies
|
5 Total Likes
View groups...
Share
Share this post:

How to Convert Date-Times using Prevailing Timezones

Posted 2 years ago

POSTED BY: Dave Middleton
2 Replies
Posted 2 years 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 2 years 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