home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / hypercar / 4596 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  1.8 KB

  1. Path: sparky!uunet!stanford.edu!apple!jkc
  2. From: jkc@Apple.COM (John Kevin Calhoun)
  3. Newsgroups: comp.sys.mac.hypercard
  4. Subject: Re: BEWARE: HyperCard and 7.1
  5. Message-ID: <75667@apple.apple.COM>
  6. Date: 16 Dec 92 17:52:32 GMT
  7. References: <athos-151292132407@kip2-32.apple.com>
  8. Organization: Apple Computer Inc, Cupertino, CA
  9. Lines: 34
  10.  
  11.  
  12. In article <athos-151292132407@kip2-32.apple.com> athos@apple.com
  13. (Rick Eames) writes:
  14. >If you have changed your date format using the new Date/Time CDEV you WILL
  15. >end up changing HyperCard's "the long date" format.  For example, if you
  16. >tell the CDEV that you don't want the day showing, the long date will NOT
  17. >give you "Thursday" or whatever day it is.
  18.  
  19. Thanks for pointing this out, Rick.  It's not documented in the Script
  20. Language Guide, but it's true:  HyperCard uses the date formats specified
  21. by System Software, not fixed formats as the Script Language Guide implies.
  22. There's a good reason why it does so:  compatibility with localized versions
  23. of System Software.
  24.  
  25. In general, you should never rely on the format of the date returned by the
  26. date function.  In particular, you should never attempt to parse a date
  27. within a script, assuming, for instance, that word 1 of the long date is
  28. the day of the week.  If you need to know the day of the week, use the
  29. convert command to convert the long date to dateItems format, and then
  30. look at item 7 of the resulting string.  This will give you the day of
  31. the week in numerical form.
  32.  
  33.   convert the long date to dateItems
  34.   put item 7 of it into dayOfWeek
  35.  
  36. In general, if you want to do calculations on dates within scripts,
  37. use the convert command to convert the date to one of the two fixed
  38. formats for dates and times, seconds or dateItems, do what you need
  39. to do in that format, and then convert back to whatever format you
  40. want to display.
  41.  
  42. Kevin Calhoun
  43. jkc@apple.com
  44.  
  45.