Stan wrote:
>
> Hi Kish,
>
> Nice proposal!
>
> A few more comments/questions/suggestions :)
>
>
> > ZMM Month of the Year with leading
> > zeros suppressed (0 to 12).
> > DD Day of the Month (01 to 31).
> > ZDD Day of the Month with leading
> > zeros suppressed (1 to 31).
> > DDD Day of the Year (000 to 366).
> > ZDDD DDD with leading zeros
> > suppressed (1 to 366).
>
> What about:
> BMM (outputs: " 1", " 2", ..., " 9", "10", "11", "12")
> and BDD (output: " 1", ..., " 9", "10", ...)
> and BDDD
> ...
>
> I.e., it seems to me there is one option missing...
>
> Let's review what people generally do when formatting a date into
> ASCII:
>
> Fixed format: (good for tabular output)
>
> Have the MM (or DD, or DDD, or WW) take exactly the specified
> number of characters (2 for MM, 3 for DDD, etc.).
>
> For fixed format, the question arises: if the "format" is 2 characters,
> but the value can be represented with 1 character (e.g., "4"), what
> should be done? There are 3 possibile answers::
>
> " 4" ---> your "ZDD"
> "04" ---> your "ZZ"
> "4 " ---> (not possible at present, and would produce
> ugly tabular output...let's not worry about it)
>
> Not-Fixed format: (good for putting dates into text)
>
> Have the MM (or DD, or DDD, or WW) take the minimum number of
> characters (values less than 10 would use a single character (the
> digit); values in range 10..99 would use two characters (digits)).
>
> So, for a "DD" output, 4 wouldb be:
>
> "4" ---> my BDD
>
> > Thus, `YYYY.MON.DAY', `YY/MM/DD', `DDMONYY', and `DD-ZMM-YYYY'
> > are valid date formats.
>
> Have your considered making MON and DAY be case sensitive?
>
> I.e.: for the date 1996-12-19 ...
>
> "DDMONYY" --> "12DEC96"
> "DDMonYY" --> "12Dec96"
>
> "YYYY Mon Day" --> "1996 Dec Thu"
>
> This would simplify generation of nice, human readable output.
> (Example: POSIX "ls -l" command, which produces dates with the month
> having an initial capital letter)
>
[other stuff snipped]
Hmmm? What's going on here? Why we're reinventing strftime(3C) one
piece at a time. Whether you like strftime % notation or not, it's
got the bases covered. So, either use strftimes format notation (lift
the code) or reinvent all of the options in the new formatting notation.
--
--------------------------------------------------------------------
Ross Scroggs email: [log in to unmask]
Telamon, Inc. CIS: 76011,2234
492 Ninth Street, Suite 310 voice: 510-987-7700
Oakland, CA 94607-4098 fax: 510-987-7009
--------------------------------------------------------------------
|