home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / rexx / 1513 < prev    next >
Encoding:
Text File  |  1993-01-27  |  1.8 KB  |  47 lines

  1. Newsgroups: comp.lang.rexx
  2. Path: sparky!uunet!ukma!cs.widener.edu!eff!world!cosell
  3. From: cosell@world.std.com (Bernie Cosell)
  4. Subject: Re: Funny thing about date() - ARexx 1.15
  5. Message-ID: <C1JC2u.6HK@world.std.com>
  6. Organization: Fantasy Farm, Pearisburg, VA
  7. X-Newsreader: TIN [version 1.1 PL8]
  8. References: <paul.04ez@dragons.DIALix.oz.au>
  9. Date: Wed, 27 Jan 1993 23:04:04 GMT
  10. Lines: 35
  11.  
  12. Paul O'Neill (paul@dragons.DIALix.oz.au) wrote:
  13. } I was recently using the date() function under ARexx 1.15 and discovered that you
  14. } can provide a second argument being the day number since, well, somewhen.
  15.  
  16. } If I call date('n', daynum) I get a date string that is correct for that day.
  17.  
  18. } If I call date('d', daynum) I get the wierdest day of the month!!!
  19.  
  20. } I set up daynum to be for February 3rd and date('d', daynum) returned 35!!
  21.  
  22. } Is this right?
  23.  
  24. Not exactly.  The DATE() function takes *three* arguments:
  25.    DATE([outputmode], [datenum], [inputmode])
  26.  
  27. outputmode determines what you'll get.  If omitted you get 'normal' form
  28. date [dd MMM yyyy].  Ther are about six or seven other mode formats
  29. ['d' gives you number of days from the beginning of the year, 'e'
  30. gets you european style [dd/mm/yy], etc].
  31.  
  32. If [datenum] is omitted, then the 'outputmode' works on the current
  33. date.  Otherwise [datenum] and [inputmode] tell DATE what date it
  34. should be working with.  If [inputmode] is omitted, then Amiga-internal
  35. format is assumed [you get that with a DATE('i'), the only alternative
  36. is 'standard' input format (yyyymmdd).   
  37.  
  38. For example, if you wanted to find the day of the week of April 3, 1985,
  39. you would just have to do:  
  40.     --> rx "say DATE('weekday', 19850403, 'standard')"
  41.     Wednesday
  42.  
  43. /Bernie\
  44. -- 
  45. Bernie Cosell                               cosell@world.std.com
  46. Fantasy Farm Fibers, Pearisburg, VA         (703) 921-2358
  47.