21.07.2015 Views

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

148 <strong>G<strong>AWK</strong></strong>: <strong>Effective</strong> <strong>AWK</strong> <strong>Programming</strong>%d The day of the month as a decimal number (01–31).%D Equivalent to specifying ‘%m/%d/%y’.%e The day of the month, padded with a space if it is only one digit.%F Equivalent to specifying ‘%Y-%m-%d’. This is the ISO 8601 date format.%g The year modulo 100 of the ISO week number, as a decimal number (00–99).For example, January 1, 1993 is in week 53 of 1992. Thus, the year of its ISOweek number is 1992, even though its year is 1993. Similarly, December 31,1973 is in week 1 of 1974. Thus, the year of its ISO week number is 1974, eventhough its year is 1973.%G The full year of the ISO week number, as a decimal number.%h Equivalent to ‘%b’.%H The hour (24-hour clock) as a decimal number (00–23).%I The hour (12-hour clock) as a decimal number (01–12).%j The day of the year as a decimal number (001–366).%m The month as a decimal number (01–12).%M The minute as a decimal number (00–59).%n A newline character (ASCII LF).%p The locale’s equivalent of the AM/PM designations associated with a 12-hourclock.%r The locale’s 12-hour clock time. (This is ‘%I:%M:%S %p’ in the "C" locale.)%R Equivalent to specifying ‘%H:%M’.%S The second as a decimal number (00–60).%t A TAB character.%T Equivalent to specifying ‘%H:%M:%S’.%u The weekday as a decimal number (1–7). Monday is day one.%U The week number of the year (the first Sunday as the first day of week one) asa decimal number (00–53).%V The week number of the year (the first Monday as the first day of week one) asa decimal number (01–53). The method for determining the week number is asspecified by ISO 8601. (To wit: if the week containing January 1 has four ormore days in the new year, then it is week one; otherwise it is week 53 of theprevious year and the next week is week one.)%w The weekday as a decimal number (0–6). Sunday is day zero.%W The week number of the year (the first Monday as the first day of week one) asa decimal number (00–53).%x The locale’s “appropriate” date representation. (This is ‘%A %B %d %Y’ in the"C" locale.)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!