• 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
Re: Issues subtracting Unix epoch from date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issues subtracting Unix epoch from date


  • Subject: Re: Issues subtracting Unix epoch from date
  • From: "Mark J. Reed" <email@hidden>
  • Date: Sun, 21 Feb 2010 13:35:32 -0500

Well, I went and saved off the TIDs and then didn't restore them.
Clearly, we had two factions, those for and against worrying about
that, and this was the compromise code they brokered...

On Sun, Feb 21, 2010 at 1:33 PM, Mark J. Reed <email@hidden> wrote:
> If you're going to do that, you might as well pass the arguments as
> arguments to perl, rather than literals inside the Perl code. That way
> you're only going through one layer of quoting (the shell's) rather
> than two (the shell's and Perl's).  You can also use Perl's
> arbitrary-quote-delimiter mechanism (qqX...X) to avoid having to use
> backslashed double-quotes.
>
> property perlTime : "perl -MTime::Local -MPOSIX -le 'print
> strftime(qq(%m/%d/%y %I:%M:%S %p), localtime timegm @ARGV)' "
>
> on GMT2localtime(yr, mon, dy, hr, min, sec)
>        set argList to {}
>        repeat with arg in {sec, min, hr, dy, (mon as integer) - 1, (yr as
> integer) - 1900}
>                set end of argList to quoted form of (arg as text)
>        end repeat
>        set oldTID to AppleScript's text item delimiters
>        set AppleScript's text item delimiters to space
>        return date (do shell script (perlTime & (argList as text)))
> end GMT2localtime
>
>
> --
> Mark J. Reed <email@hidden>
>



--
Mark J. Reed <email@hidden>
 _______________________________________________
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

References: 
 >re: Issues subtracting Unix epoch from date (From: airdrummer <email@hidden>)
 >Re: Issues subtracting Unix epoch from date (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Issues subtracting Unix epoch from date
  • Next by Date: Repeat Until Dialog is Acknowledged?
  • Previous by thread: Re: Issues subtracting Unix epoch from date
  • Next by thread: Re: re: Issues subtracting Unix epoch from date
  • Index(es):
    • Date
    • Thread