• 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
How to get Zero (0) before Month ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get Zero (0) before Month ?


  • Subject: How to get Zero (0) before Month ?
  • From: Krister Nyman <email@hidden>
  • Date: Sun, 16 Feb 2003 16:35:40 +0100

When I use this script :

set the_months to "January February March April May June July August
September October November
December"
set message_date to current date
set mess_year to year of message_date as string
set mess_day to day of message_date as string
set day_count to count characters in mess_day
if day_count = 1 then set mess_day to "0" & mess_day
set mess_month to month of message_date as string
repeat with x from 1 to count words in the_months
if mess_month = word x of the_months then set month_count to x as
string
end repeat
set date_format to mess_year & "/" & month_count & "/" & mess_day


I get result "2003/2/16" thats great, but I wonder how to get this
"2003/02/16" ?

I always want to have month in two numbers, 01,02,03,04,05.....10,11,12
like it is with days.

MacOS 9.2.2

Regards

Krister Nyman
_______________________________________________
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.

  • Follow-Ups:
    • Re: How to get Zero (0) before Month ?
      • From: John Delacour <email@hidden>
    • Re: How to get Zero (0) before Month ?
      • From: Michael Grant <email@hidden>
    • Re: How to get Zero (0) before Month ?
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Tex-Edit: what's wrong with this variable?
  • Next by Date: Using ticks in AS Studio??
  • Previous by thread: eudora & remote access connect script
  • Next by thread: Re: How to get Zero (0) before Month ?
  • Index(es):
    • Date
    • Thread