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

Re: date format


  • Subject: Re: date format
  • From: Jan Erik Moström <email@hidden>
  • Date: Tue, 27 Nov 2001 18:48:21 +0100

I usually use something like this

on makeFormattedDate(ftype, currentDate)
copy currentDate to b
set month of b to January
if ftype is "YYYY-MM-DD" then
set x to 1 + ((currentDate - b + 1314864) div 2629728)
set shortCreateDate to ((year of currentDate as text) & "-" & x as text) & ,
"-" & day of currentDate
else if ftype is "DD/MM/YYYY" then
set x to 1 + ((currentDate - b + 1314864) div 2629728)
set shortCreateDate to (day of currentDate as text) & "/" & (x as text) &
"/" & ,
text -4 thru -1 of (year of currentDate as text)
else if ftype is "MM/DD/YYYY" then
set x to 1 + ((currentDate - b + 1314864) div 2629728)
set shortCreateDate to (x as text) & "/" & day of currentDate & "/" & ,
text -4 thru -1 of (year of currentDate as text)
else
display dialog "No valid date format defined"
end if
return shortCreateDate
end makeFormattedDate

which allows me to use different date formats without any OSAXs

jem
--
Jan Erik Mostrvm mailto:email@hidden
Free Elektron http://www.mostrom.pp.se/folk/jem/


  • Prev by Date: Re: date format
  • Next by Date: Re: date format
  • Previous by thread: Re: date format
  • Next by thread: Re: date format
  • Index(es):
    • Date
    • Thread