• 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:33:45 +0100

At 1:21 pm -0700 20/8/03, Michelle Steiner wrote:
On Wednesday, August 20, 2003, at 12:42 PM, Rich Carroll wrote:

Is there a simple way to coerce "August 20, 2003" to 08/20/03?

Unfortunately, not.

Well it's not _that_ complicated ...


set _date to (current date)
set ls to words of "ja f mar ap ma jun j a s o n d"
set d to text -2 through -1 of ("0" & day of _date)
set m to "" & month of _date
repeat with i from 1 to 12
if m begins with item i of ls then
set m to text -2 through -1 of ("0" & i)
exit repeat
end if
end repeat
set y to text -2 through -1 of ("" & year of _date)
m & "/" & d & "/" & y

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: 
 >Re: Coerce time (From: Michelle Steiner <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