Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Date trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date trouble




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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.