Debian Codegraph @

awklib/eg/lib/ctime.awk

raw
1 # ctime.awk
2 #
3 # awk version of C ctime(3) function
4
5 function ctime(ts, format)
6 {
7 format = "%a %b %e %H:%M:%S %Z %Y"
8
9 if (ts == 0)
10 ts = systime() # use current time as default
11 return strftime(format, ts)
12 }