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

Re: Date trouble


  • Subject: Re: Date trouble
  • From: Michelle Steiner <email@hidden>
  • Date: Fri, 20 Oct 2006 07:41:44 -0700


On Oct 20, 2006, at 5:16 AM, Wayne Melrose wrote:

set d to current date
set d_d to day of d
set d_m to month of d
set d_y to year of d
etc.....

then make a string of each part.. like i said.. dodgy..

Can anyone show us the correct way?

Well, I can clean that up a little:

set d to current date
set foo to {year of d, month of d as integer, day of d}
set text item delimiters to "-"
set today to (foo as text)
set text item delimiters to ""
set today to today & " " & time string of d

--> "2006-10-20 7:41:26 AM"

--
"Experience in that marvelous thing that enables you to recognize a mistake when you make it again." --F. P. JONES



_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Date trouble (From: "W. Thomas Leroux" <email@hidden>)
 >Re: Date trouble (From: Wayne Melrose <email@hidden>)

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