ctime.awk 234 B

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