home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!apple!jkc
- From: jkc@Apple.COM (John Kevin Calhoun)
- Newsgroups: comp.sys.mac.hypercard
- Subject: Re: BEWARE: HyperCard and 7.1
- Message-ID: <75667@apple.apple.COM>
- Date: 16 Dec 92 17:52:32 GMT
- References: <athos-151292132407@kip2-32.apple.com>
- Organization: Apple Computer Inc, Cupertino, CA
- Lines: 34
-
-
- In article <athos-151292132407@kip2-32.apple.com> athos@apple.com
- (Rick Eames) writes:
- >If you have changed your date format using the new Date/Time CDEV you WILL
- >end up changing HyperCard's "the long date" format. For example, if you
- >tell the CDEV that you don't want the day showing, the long date will NOT
- >give you "Thursday" or whatever day it is.
-
- Thanks for pointing this out, Rick. It's not documented in the Script
- Language Guide, but it's true: HyperCard uses the date formats specified
- by System Software, not fixed formats as the Script Language Guide implies.
- There's a good reason why it does so: compatibility with localized versions
- of System Software.
-
- In general, you should never rely on the format of the date returned by the
- date function. In particular, you should never attempt to parse a date
- within a script, assuming, for instance, that word 1 of the long date is
- the day of the week. If you need to know the day of the week, use the
- convert command to convert the long date to dateItems format, and then
- look at item 7 of the resulting string. This will give you the day of
- the week in numerical form.
-
- convert the long date to dateItems
- put item 7 of it into dayOfWeek
-
- In general, if you want to do calculations on dates within scripts,
- use the convert command to convert the date to one of the two fixed
- formats for dates and times, seconds or dateItems, do what you need
- to do in that format, and then convert back to whatever format you
- want to display.
-
- Kevin Calhoun
- jkc@apple.com
-
-