• 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: parsing Unix date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parsing Unix date


  • Subject: Re: parsing Unix date
  • From: Doug McNutt <email@hidden>
  • Date: Fri, 9 Jan 2004 11:08:33 -0700

On Jan 9, 2004, at 8:48 AM, Michael Grant wrote:
>set d to (do shell script "date") --> "Fri Jan 9 01:00:02 CST 2004"
>date d --> date "Friday, January 9, 2004 9:01:00 AM"

Is the problem that the dates are 58 seconds apart? Or is it the abbreviations? Or is it that one includes the time zone?

Even more interesting I get 10:57 for the UNIX date and 09:57 for the second option. It's as though AppleScript on my new Panther installation thinks I'm on daylight time.

The UNIX date command has all kinds of formatting options if it's used with an argument. man date will get you started on that. It can also use the environment variable $TZ (time zone) which doesn't seem to be provided by Panther. (Is that a bug?)

My preferences are set for Denver with a 24 hour clock and leading zeros. This snippet is interesting. It's almost as though the ninth day of January is being treated as the hour.

do shell script "date"
set d to result
set e to date d
d & return & e

"Fri Jan 9 11:02:16 MST 2004
Friday, January 9, 2004 09:11:02"

--
--> There are 10 kinds of people: those who understand binary, and those who don't <--
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: parsing Unix date
      • From: Michael Grant <email@hidden>
References: 
 >parsing Unix date (From: Michael Grant <email@hidden>)
 >Re: parsing Unix date (From: Craig Sutherland <email@hidden>)
 >Re: parsing Unix date (From: Michael Grant <email@hidden>)

  • Prev by Date: [ANNOUNCE] XSLT Tools 2.0b1
  • Next by Date: Re: Safari windows
  • Previous by thread: Re: parsing Unix date
  • Next by thread: Re: parsing Unix date
  • Index(es):
    • Date
    • Thread