FW: asctime.c

Clive D.W. Feather clive at demon.net
Wed Jul 28 05:00:19 UTC 2004


Olson, Arthur David (NIH/NCI) said:
> for a 2 character field, it probably doesn't matter, except possibly for the
> value 0 (where a system that likes %.2d might produce just " 0" if given
> %02d - the "0" in the format (SysIII variant) requires a leading 0 in the
> result, or something like that, so for 1, you should get 01, but for 0 ...)

"%02d" means "minimum 2 characters, fill with zeroes"
"%.2d" means "minimum 2 digits, no fill"; "%0.2d", "%02.2d", and "%2.2d"
  all mean the same.

For values in the range 0 to 9, both generate "00" to "09".
For values like -4, the former generates "-4" and the latter "-04".

-- 
Clive D.W. Feather  | Work:  <clive at demon.net>   | Tel:    +44 20 8495 6138
Internet Expert     | Home:  <clive at davros.org>  | Fax:    +44 870 051 9937
Demon Internet      | WWW: http://www.davros.org | Mobile: +44 7973 377646
Thus plc            |                            |



More information about the tz mailing list