>From the Linux command line try the following for UNIX time: date +%s
The C header time.h is readily available e.g. here: http://pubs.opengroup.org/onlinepubs/009696699/basedefs/time.h.html Be a bit careful with UNIX time (and UTC generally), which is the number of seconds since January 1 1970 0:00:00. As you likely know, UTC adds (or subtracts, but this has not yet occurred) leap seconds unpredictably (to keep track with UT1), and to compensate for this there is what can only be described as a groundhog second as the leap second is added at the end of the day and then the clock ticks backwards for a second. With positive leap seconds, some Unix time numbers are therefore ambiguous; in addition some systems may not conform to the POSIX standard. There has been a proposal to fix UTC, but the Brits seem to be digging their heels in. (Personal view: GPS time makes more sense, as it ticks monotonically and is now readily available). Regards Jo. On 20 October 2013 15:58, Ric Sherlock <tikk...@gmail.com> wrote: > I agree it would be great to make these additions to the addon > cross-platform. I'm also clueless on the best ways to do this outside > Windows (which is why they aren't there already ;)) > Anybody have any advice? > > > On Sun, Oct 20, 2013 at 1:37 PM, Pascal Jasmin <godspiral2...@yahoo.ca > >wrote: > > > adding 4 functions to this file: > > > > ~addons/types/datetime/datetime.ijs > > > > > > Now_z_ =: 6!:0 > > utcBIAS_z_ =: 0,~ >1{ getTimeZoneInfo_rgsdatetime_ '' > > utc_z_ =: tsPlus&utcBIAS > > utcnow_z_ =: utc@:Now > > > > > > utcBIAS > > 300 0 > > this gives a utc adjusted current local time: > > utcnow '' > > 2013 10 20 1 9 21.346 > > > > utcBIAS relies on the windows api. Though its a noun set once at > startup, > > It's kludgy in case of running after a DST change or other system clock > > change. > > > > > > Is there a cygwin (or other windows) api call to get utctime, that would > > be easily portable to unix/mac and smartphones? > > > > If not, do each of the platforms have a command line or dll call to set > > utcBIAS? > > > > which approach would be recommended? > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm