Stan writes:

> If you saw Steve's posts about time(), that was an offline
> conversation that leaked by accident.
>
> FYI, here's what I said about it:
[snip clear explanations]

All this time/hardware clock/software clock discussion is giving
me a headache.  Do you realize how many ways one can get the date
in a COBOL program (most of which apply to other languages as well)?
Let's give it a whirl:

        1. CURRENT-DATE constant
        2. CURRENT-DATE function (POST85)
        3. CALENDAR   intrinsic (not recommended ;)
        4. HPCALENDAR intrinsic (5.5 pp4)
        4. DATELINE   intrinsic (can't manipulate results easily)
        5. ALMANAC    intrinsic (includes DOW, which is nice)

Is there some "rule of thumb" that says when it is advisable
to use each?  I'll try a first pass:

1. CURRENT-DATE constant
        - COBOL standard
        - simplest to use
        - no allowance for multiple time zones
        - provides only 2-digit year

2. CURRENT-DATE function
        - COBOL standard
        - more complex than CURRENT-DATE constant
        - supports multiple time zones (set TZ!)
        - provides 4-digit year

3. CALENDAR intrinsic
        - don't

4. HPCALENDAR intrinsic
        - use only if date arithmetic is needed for the current date

5. DATELINE intrinsic
        - use only as a banner line in the U.S.A for a single time zone
          (no localized formatting)

6. ALMANAC intrinsic
        - get Day Of Week
        - use with NLFMTCALENDAR() for localized format


This last bit brings up an interesting question (for those of you
still reading ;) :

        If it was important enough to bring out HPCALENDAR to replace
        CALENDAR, will there be an HPALMANAC to replace ALMANAC (which
        returned the same format as CALENDAR, plus other fields),
        HPNLFMTCALENDAR, etc.?

The NLS functions are available on HP-UX as well; what's being done there?

It all starts to feel like that song... "Ball of Confusion."

--Glenn Cole
  Software al dente, Inc.
  [log in to unmask]

.......................................................................

Item Subject: cc:Mail Text