Convert date to seconds

Thomas McGrath III mcgrath3 at mac.com
Wed Jul 17 21:03:26 EDT 2013


I am converting the short date (08/16/13) to seconds and I get 1376625600

My question is "Is the converted seconds always that many digits when converted from that type of date?" 

The reason I ask is I am making filenames by merging a name like "Thomas" or "Tom" with the date converted to seconds as in "Thomas1376625600.txt" or "Tom1376625600.txt" 

I would like to script this conversion like:

put char -10 to the number of chars of tFilename into tSeconds
put char 1 to -10 of tFilename into tName

--put "1376625600" into tSeconds
convert tSeconds to short date

and now tName should be either "Tom" or "Thomas" regardless of length and tSeconds will be "08/16/13" so I can use them in my app.

This will not work if the converted seconds ever gets longer ( over the next twenty or thirty years or so).

So, Does the converted seconds always stay at 10 digits in this scenario?

Thanks

Tom

-- Tom McGrath III
http://lazyriver.on-rev.com
mcgrath3 at mac.com




More information about the use-livecode mailing list