This enhancement request (which from various paths has a 14 year history) is still relevant IMHO:

https://quality.livecode.com/show_bug.cgi?id=4636

(It also has a handy suggestion from Mark Waddingham of a function to return "ISO date time" (as the discussions in the report shows, a misnomer), complete with presumed correct time zone.)

On 30/10/2020 21:28, J. Landman Gay via use-livecode wrote:
Good point. For our situation, hours were enough so I guess I ignored the rest (it was a long time ago and the code is old.)

On 10/30/20 3:24 PM, Alex Tweedly via use-livecode wrote:
But that will only work for those time zones whose variation from UTC is an exact number of hours.

the internet date has 4 digits so that it can handle hour and minute variations - you could change

   subtract (char 1 to -3 of last word of the internet date) from item 4 of tTime

to

   put the last word of the internet time into tmp
   subtract (char 1 to -3 of tmp) from item 4 of tTime
   subtract (char 1 of tmp & char -2 to -1 of tmp) ) from item 5 of tTime

and then you would be handling all cases correctly.

Alex.

On 30/10/2020 20:06, J. Landman Gay via use-livecode wrote:
On 10/29/20 4:33 PM, Graham Samuel via use-livecode wrote:
The only souci with this format is that it gives the month in alpha, presumably according to the nationality of the OS. But it’s easy to get the numeric month in other ways. Still, it is just a little bit fiddly to create a full UTC date of the format:

YYYY-MM-DDThh:mm:ssTZD

Here's something I use:

  put the seconds into tTime
  convert tTime to dateitems
  subtract (char 1 to -3 of last word of the internet date) from item 4 of tTime
  convert tTime to dateitems
  set the numberformat to "00"
  put item 1 of tTime &"-"& (item 2 of tTime)+0 &"-"& (item 3 of tTime)+0 & "T" & (item 4 of tTime)+0 &":"& \
        (item 5 of tTime)+0 &":"& (item 6 of tTime)+0 & "Z" into tTimestamp


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to