Date and time format question

J. Landman Gay jacque at hyperactivesw.com
Tue Jul 30 03:00:55 EDT 2024


  Similar to Bob's but includes the delimiters:

 -- create UTC timestamp: -- format: "2013-07-20T00:00:00Z"
  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
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On July 29, 2024 4:11:37 PM Paul Dupuis via use-livecode 
<use-livecode at lists.runrev.com> wrote:

> Follow up question/request:
>
> put the internet date into tTimestamp -- stores something like Mon, 29
> Jul 2024 16:49:52 -0400, where the -0400 is the time zone offset
>
> Anyone have some already written code to convert this to a time in GMT
> (i.e where the time zone offset is +0000, i.e. Mon, 29 Jul 2024 20:49:52
> +0000)?
>
> It is adding the offset to the hours and minutes, but you have to handle
> carry over, potentially adding or subtracting a day.
>
> If the best approach converting to seconds and the doing the math and
> converting back? (I think this is the answer)
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode






More information about the use-livecode mailing list