Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting the date



This solution should work fine. It is independent of any localization settings that you may have for date and time formats. I believe it requires AppleScript 1.9 or later.
-------------
on ZeroPad(theNumber)
set theString to ""
if theNumber is less than 10 then set theString to "0"
set theString to theString & theNumber
return theString
end ZeroPad

set theDate to current date
set dayString to ZeroPad((day of theDate) as integer)
set monthString to ZeroPad((month of theDate) as integer)
set yearString to ZeroPad((year of theDate) mod 100)

set theDateString to yearString & monthString & dayString
-------------

- Ken

On Dec 30, 2003, at 10:37 AM, Simon Kidd wrote:

Iam trying to make a folder with the current date, Ive found that:

set days_date to current date

gives me the date and time in this format "date "Tuesday, 30 December, 2003 10.34.27am""

is there a way of getting the date like so: "031230"
_______________________________________________
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: 
 >getting the date (From: Simon Kidd <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.