It depends on which format of datetime that you are given to work with, and
often you have no control over it.

I am thinking of a new foreign conjunction like 6!:0 that can return
datetime in utc and string in formats compatible with strftime.

strptime is also helpful but it is not available on windows. c#/.net have
become api of windows, old c api are not well supported.

On Thu, Dec 27, 2018, 3:44 AM Raul Miller <[email protected] wrote:

> I ran into a situation today, where I need to handle time zones in J.
>
> After poking around a bit, I found
>
>
> https://code.jsoftware.com/wiki/User:Ric_Sherlock/Extend_Dates_Project/DatesAdd_Script
>
> and
>
> http://www.jsoftware.com/pipermail/programming/2014-March/036357.html
>
> So, basically, here's my impression of where things are at:
>
> (1) time zones are an issue which people need to deal with relatively
> often.
>
> (2) the details are arbitrary, vary from year to year and based on the
> government in charge of the location in question.
>
> So:
>
> (3) There's almost always some sort of time zone database included
> with every modern operating system.
>
> Currently, we've got informal partial support for time zones (only for
> Windows - not for OSX, Linux, etc.).  For the unix parts of the world,
> probably https://man.openbsd.org/gettimeofday.2 or maybe as a
> fallback:
> https://www.gnu.org/software/libc/manual/html_node/Time-Zone-Functions.html
> is the way to go...
>
> That's more work than my current project warrants - I'm just going to
> use a hard coded constant for now, and maybe turn that into a prompted
> thing later, if necessary. But I might come back to this issue at some
> point... (and I expect other people will, also --  this is, after all,
> an issue that people need to deal with relatively often).
>
> FYI,
>
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm


On Thu, Dec 27, 2018, 3:44 AM Raul Miller <[email protected] wrote:

> I ran into a situation today, where I need to handle time zones in J.
>
> After poking around a bit, I found
>
>
> https://code.jsoftware.com/wiki/User:Ric_Sherlock/Extend_Dates_Project/DatesAdd_Script
>
> and
>
> http://www.jsoftware.com/pipermail/programming/2014-March/036357.html
>
> So, basically, here's my impression of where things are at:
>
> (1) time zones are an issue which people need to deal with relatively
> often.
>
> (2) the details are arbitrary, vary from year to year and based on the
> government in charge of the location in question.
>
> So:
>
> (3) There's almost always some sort of time zone database included
> with every modern operating system.
>
> Currently, we've got informal partial support for time zones (only for
> Windows - not for OSX, Linux, etc.).  For the unix parts of the world,
> probably https://man.openbsd.org/gettimeofday.2 or maybe as a
> fallback:
> https://www.gnu.org/software/libc/manual/html_node/Time-Zone-Functions.html
> is the way to go...
>
> That's more work than my current project warrants - I'm just going to
> use a hard coded constant for now, and maybe turn that into a prompted
> thing later, if necessary. But I might come back to this issue at some
> point... (and I expect other people will, also --  this is, after all,
> an issue that people need to deal with relatively often).
>
> FYI,
>
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to