>      How can I get MetaCard to handle dates in an international format,
>that is, as day/month/year, rather than American format (month/day/year)?

The only "official" international date format is the ISO format which is:

     YYYYMMDDHHMMSS or with separators YYYY-MM-DD HH:MM:SS

I know of several governmental organisations, not just in the UK 
switching over to this form of date (or date & time) for computerised 
systems.  Here are some simple handlers I use to help with various 
date issues:

function isoDate ukDate  -- in: D/M/YYYY, out: YYYYMMDD
   convert ukDate to dateItems
   set itemDelimiter to comma
   put item 1 of ukDate \
       & (char -2 to -1 of ("0" & item 2 of ukDate)) \
       & (char -2 to -1 of ("0" & item 3 of ukDate)) into isoFormat
end isoDate

function formattedISOdate isoDate  -- in: YYYYMMDD, out: YYYY/M/D
   return format("%s/%d/%d", char 1 to 4 of isoDate, (char 5 to 6 of 
isoDate)+0,(char 7 to 8 of isoDate)+0)
end formattedISOdate

function formattedUKdate isoDate  -- in: YYYYMMDD, out: D/M/YYYY
   return format("%d/%d/%4d", (char 7 to 8 of isoDate),(char 5 to 6 of 
isoDate),(char 1 to 4 of isoDate))
end formattedUKdate

function isLeapYear theYear  -- in: YYYY
   return ((theYear mod 4 = 0) and (theYear mod 100 <> 0)) or (theYear 
mod 400 = 0)
end isLeapYear

I'm sure these could be improved upon, but they do the job!

Cheers
Peter
-- 
--------------------------------------------------------
Peter Reid
Reid-IT Limited, Loughborough, Leics., UK
Tel: +44 (0)1509 268843 Fax: +44 (0)870 052 7576
E-mail: [EMAIL PROTECTED]
Web: http://www.reidit.co.uk

Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to