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