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

Re: Current date notation


  • Subject: Re: Current date notation
  • From: Dennis Wurster <email@hidden>
  • Date: Fri, 11 May 2001 09:52:27 -0400

>But instead of calling the current date osax 3 times you could set it to a
>variable and just call it that once.
>
>--
>Paul Berkowitz

Okay, here's a revision. A little less readable me (I'm a total newbie),
but two fewer calls to the current date function.

For the record, Apple's applescript website has a far more flexible
solution in it's 'current date OSAX' help center module.

http://www.apple.com/applescript/help_mods.html

-----

set {m, d, y} to {month, day, year} of (current date)

set monthList to {January, February, March, April, May, June, July,
August, September, October, November, December}

repeat with i from 1 to 12
if m = (item i of monthList) then
set monthString to text -2 thru -1 of ("0" & i)
exit repeat
end if
end repeat

set dayString to text -2 thru -1 of ("0" & d)
set resultString to dayString & "-" & monthString & "-" & y

-------

-=Dennis=-

------------------------
Dennis Wurster
Senior IT Specialist
Infantino Associates


  • Follow-Ups:
    • Re: Current date notation
      • From: John W Baxter <email@hidden>
  • Prev by Date: Re: Rogue list?
  • Next by Date: Re: Current date notation
  • Previous by thread: Re: Current date notation
  • Next by thread: Re: Current date notation
  • Index(es):
    • Date
    • Thread