ISO 8601 date to seconds

Geoff Canyon gcanyon at gmail.com
Thu Jan 29 00:28:04 EST 2015


On Wed, Jan 28, 2015 at 8:12 PM, Brahmanathaswami <brahma at hindu.org> wrote:

> 2000-02-17T22:13:21-05
>
> As anyone written a script to convert this to seconds?
>

If the positioning is fixed (as is implied by the leading 0s) then I think
this will work:

function S D
   put format("%s/%s/%s %s",char 6 to 7 of D,char 9 to 10 of D,char 1 to 4
of D,char 12 to 19 of D) into R
   convert R to seconds
   return R + 3600 * char -3 to -1 of D
end S



More information about the use-livecode mailing list