Re: Time Stamp String
Re: Time Stamp String
- Subject: Re: Time Stamp String
- From: Bill White <email@hidden>
- Date: Mon, 14 Mar 2005 16:29:43 -0500
On 3/14/05 3:55 PM, Todd Geist <email@hidden> wrote:
> I wanted to create a routine that would take the current date and return it
> in the form
>
> yyyymmdd_time
Try this:
on TimeStampString(theDate)
set d to day of theDate as string
-- pad with a zero if needed
set theDay to characters -2 thru -1 of ("0" & d) as string
set m to month of theDate as integer as string
-- pad with a zero if needed
set theMonth to characters -2 thru -1 of ("0" & m) as string
set theYear to year of theDate
set theTime to time of theDate
return theYear & theMonth & theDay & "_" & theTime as string
end TimeStampString
Also, in your script, the last part of the handler...
return theFullString
set text item delimiters to tid
...would make it that the text item delimiters will never be reset to their
original state because you're returning theFullString first, hence exiting
out of the handler before restoring them.
--Bill
_______________________________________________
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