• 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: Coerce time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coerce time


  • Subject: Re: Coerce time
  • From: John Delacour <email@hidden>
  • Date: Wed, 20 Aug 2003 22:09:22 +0100

At 2:42 pm -0500 20/8/03, Rich Carroll wrote:
Is there a simple way to coerce "August 20, 2003" to 08/20/03?
I can figure out a complicated series of steps to do it "manually," I'm just
hoping someone knows a better way.

You can do it in the shell or with perl:


set d1 to "1/1/70"
set d2 to "August 20, 2003"
set d to (get date d2) - (get date d1) -- or (current date) - (get date d1)
do shell script "perl -e '@t = localtime " & d & ";
printf qq~d/d/d~, $t[4]+1,$t[3],$t[5] ;'"

JD



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

References: 
 >Coerce time (From: Rich Carroll <email@hidden>)

  • Prev by Date: Re: Coerce time
  • Next by Date: Re: Coerce time
  • Previous by thread: Re: Coerce time
  • Next by thread: Re: Coerce time
  • Index(es):
    • Date
    • Thread