Convert date to seconds

dunbarx at aol.com dunbarx at aol.com
Wed Jul 17 21:34:31 EDT 2013


Tom.


You have nearly 20 years until another digit is added.


Of course, you can always prepare for this right now. Just test the length of the seconds, and if it is eleven then modify your chunk stuff.


Craig Newman



-----Original Message-----
From: Dar Scott <dsc at swcp.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Wed, Jul 17, 2013 9:21 pm
Subject: Re: Convert date to seconds


Will the create of file names be in the same time zone as the reader of file 
names?

On Jul 17, 2013, at 7:03 PM, Thomas McGrath III wrote:

> 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
> 
> _______________________________________________
> 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


_______________________________________________
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