Epoch Seconds to YYYY-MM-DD
Epoch Seconds to YYYY-MM-DD
- Subject: Epoch Seconds to YYYY-MM-DD
- From: Marconi <email@hidden>
- Date: Sat, 27 Apr 2013 08:25:32 -0700
I am trying to pass a number like "1157445071" to a shell script but AS keeps converting the passed value, such as "1157445071", to "1.157445071E+9" scientific notation.
How do I prevent AS turning large integers into mush that the shell script does not like?
FYI, I'm just doing do shell script "date -r [some value for epoch seconds] '+%Y-%m-%d'"
What I'm using this for is starting with today's date and generating dates (format YYYY-MM-DD) back for each of X dates prior.
I.e.,
2013-04-27
2013-04-26
2013-04-25
2013-04-24
2013-04-23
...
2013-03-31
2013-03-30
etc.
I thought I'd just get the epoch seconds for today and iterate through a loop, subtracting 86,400 from the original epoch seconds and converting each to YYYY-MM-DD format with the shell script.
If there's an easier way to do this in AS, I'd like to hear it.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden