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

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

References: 
 >Time Stamp String (From: Todd Geist <email@hidden>)

  • Prev by Date: AppleScript feature request - encryption
  • Next by Date: Re: which app?
  • Previous by thread: Re: Time Stamp String
  • Next by thread: Re: Time Stamp String
  • Index(es):
    • Date
    • Thread