source: trunk/essentials/sys-apps/gawk/test/strftime.awk

Last change on this file was 3076, checked in by bird, 18 years ago

gawk 3.1.5

File size: 504 bytes
Line 
1# strftime.awk ; test the strftime code
2#
3# input is the output of `date', see Makefile.in
4#
5# The mucking about with $0 and $N is to avoid problems
6# on cygwin, where the timezone field is empty and there
7# are two consecutive blanks.
8
9# Additional mucking about to lop off the seconds field;
10# helps decrease chance of difference due to a second boundary
11
12{
13 $3 = sprintf("%02d", $3 + 0)
14 $4 = substr($4, 1, 5)
15 print > "strftime.ok"
16 $0 = strftime("%a %b %d %H:%M %Z %Y")
17 $NF = $NF
18 print > OUTPUT
19}
Note: See TracBrowser for help on using the repository browser.