Page 1 of 1

converting Date and time to seconds

Posted: Wed Apr 23, 2014 3:03 am
by tasdvl9
Hello,

I've been searching quite a bit and haven't been able to figure out the 'livecode' way to convert this string to seconds..
1/1/08 3:06 AM

Any ideas?

Thanks!

Re: converting Date and time to seconds

Posted: Wed Apr 23, 2014 3:21 am
by Simon
Take a look at "convert" in the dictionary.

Simon

Re: converting Date and time to seconds

Posted: Wed Apr 23, 2014 3:29 am
by tasdvl9
Thanks for the response.

I tried using something like this:
convert tNewDateTo from date and long time to seconds

To no avail.

Converting the date is easy. But suppose you want to do a compare on not only the date but the time as well?
I thought perhaps you could convert both the date to seconds and then the time to seconds and add both but that was uneventful
as well.

Re: converting Date and time to seconds

Posted: Wed Apr 23, 2014 3:42 am
by Simon
hmmm
This is from the dictionary examples
convert the date && the time to seconds
Simon

Re: converting Date and time to seconds

Posted: Wed Apr 23, 2014 3:53 am
by Dixie

Code: Select all

on mouseUp
   put "1/1/08 3:06 AM" into theTime
   convert theTime to seconds
   put theTime
end mouseUp

Re: converting Date and time to seconds

Posted: Wed Apr 23, 2014 4:51 am
by tasdvl9
Thanks, Guys!

My syntax was incorrect thus causing my issue.

I appreciate all of the responses :)