GNU Info

Info Node: (sh-utils.info)Padding

(sh-utils.info)Padding


Next: Setting the time Prev: Literal directives Up: date invocation
Enter node , (file) or (file)node

Padding
-------

   By default, `date' pads numeric fields with zeroes, so that, for
example, numeric months are always output as two digits. GNU `date'
recognizes the following numeric modifiers between the `%' and the
directive.

`-'
     (hyphen) do not pad the field; useful if the output is intended for
     human consumption.

`_'
     (underscore) pad the field with spaces; useful if you need a fixed
     number of characters in the output, but zeroes are too distracting.

These are GNU extensions.

   Here is an example illustrating the differences:

     date +%d/%m -d "Feb 1"
     => 01/02
     date +%-d/%-m -d "Feb 1"
     => 1/2
     date +%_d/%_m -d "Feb 1"
     =>  1/ 2


automatically generated by info2www version 1.2.2.9