format: Make fmt_date_template() human-friendly, respect field width.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 17 Jul 2012 06:36:30 +0000 (23:36 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 17 Jul 2012 14:09:57 +0000 (07:09 -0700)
commit142e33869c4c04338e6071e011b3053a28ea9173
tree46bd0ba55a8203dd58adfd63984924f013d18657
parentb49a1e914091def9823df400fe5d97a6d4222c2a
format: Make fmt_date_template() human-friendly, respect field width.

The strings that fmt_date_template() returned were almost but not
quite the kind of strings that humans expect to see.  For one, they
always used "yy", even though the code uses 4-digit years ("yyyy")
when the field width is sufficient.  Similarly, they never included
seconds (i.e. omitted ":SS").  Finally, FMT_MOYR had an "X" where
one would expect a space.

This commit corrects all of the above issues.  Future commits will
make more use of fmt_date_template().
src/data/data-in.c
src/data/data-out.c
src/data/format.c
src/data/format.h