Identifier: date_format

Type

string

Description

A user-defined format for date/time output. This format is used when the date mode (set by the numeric identifier date_mode) has the value 9.

The format is of the form used by the C function strftime. The following table is an extract from the Sun/Solaris documentation for strftime, and the meanings and availability may vary for other systems. The relative C language documentation should be consulted for a definitive description.

Primer

Meaning

%%

same as %

%a

locale's abbreviated weekday name

%A

locale's full weekday name

%b

locale's abbreviated month name

%B

locale's full month name

%c

locale's appropriate date and time representation

%C

* locale's date and time representation as produced by date(1)

%d

day of month [1,31]; single digits are preceded by 0

%D

* date as %m/%d/%y

%e

* day of month [1,31]; single digits are preceded by a space

%h

* locale's abbreviated month name

%H

hour (24-hour clock) [0,23]; single digits are preceded by 0

%I

hour (12-hour clock) [1,12]; single digits are preceded by 0

%j

day number of year [1,366]; single digits are preceded by 0

%k

* hour (24-hour clock) [0,23]; single digits are preceded by a blank

%l

* hour (12-hour clock) [1,12]; single digits are preceded by a blank

%m

month number [1,12]; single digits are preceded by 0

%M

minute [00,59]; leading zero is permitted but not required

%n

* insert a newline

%p

locale's equivalent of either a.m. or p.m.

%r

* appropriate time representation in 12-hour clock format with %p

%R

* time as %H:%M

%S

seconds [00,59]

%t

* insert a tab

%T

* time as %H:%M:%S

%u

* weekday as a decimal number [1,7], with 1 representing Sunday

%U

week number of year as a decimal number [00,53], with Sunday as the first day of week 1

%V

* week number of the year as a decimal number [01,53], with Monday as the first day of the week. If the
week containing 1 January has four or more days in the new year, then it is considered week 1; otherwise, it is week 53 of the previous year, and the
next week is week 1.

%w

weekday as a decimal number [0,6], with 0 representing Sunday

%W

week number of year as a decimal number [00,53], with Monday as the first day of week 1

%x

locale's appropriate date representation

%X

locale's appropriate time representation

%y

year within century [00,99]

%Y

year, including the century (for example 1993)

%Z

time zone name or abbreviation, or no bytes if no time zone information exists

* Note: This primer is not available on Microsoft Windows systems