• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Epoch Seconds to YYYY-MM-DD
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Epoch Seconds to YYYY-MM-DD
      • From: Barry Wainwright <email@hidden>
    • Re: Epoch Seconds to YYYY-MM-DD
      • From: Jon Pugh <email@hidden>
    • Re: Epoch Seconds to YYYY-MM-DD
      • From: Christopher Stone <email@hidden>
  • Prev by Date: Re: Execute Javascript on an HTML file
  • Next by Date: Re: Epoch Seconds to YYYY-MM-DD
  • Previous by thread: Re: Making a List of Lists
  • Next by thread: Re: Epoch Seconds to YYYY-MM-DD
  • Index(es):
    • Date
    • Thread