seconds 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. .TH SECONDS 1
  2. .SH NAME
  3. seconds \- convert human-readable date (and time) to seconds since epoch
  4. .SH SYNOPSIS
  5. .B seconds
  6. .I date
  7. \&...
  8. .SH DESCRIPTION
  9. .I Seconds
  10. prints the number of seconds since 1 Jan 1970
  11. corresponding to one or more human-readable
  12. .IR date s.
  13. Each
  14. .I date
  15. must be
  16. .I one
  17. argument;
  18. it will usually be necessary to enclose it in quotes.
  19. .PP
  20. .I Seconds
  21. accepts a somewhat wider range of input than just output from
  22. .IR date (1).
  23. The main requirement is that the date must be fully specified,
  24. with a day of month, month and year
  25. in any order.
  26. The month must be an English name (or abbreviation),
  27. not a number, and the year must contain 4 digits.
  28. Unambiguous time-zone names are understood (i.e., not
  29. .LR IST )
  30. or time zones may be written as
  31. .IR ±hhmm .
  32. Case is ignored.
  33. .SH EXAMPLES
  34. Print the names of all files under
  35. .L \&.
  36. modified since the start of 23 May 2011.
  37. .IP
  38. .EX
  39. du -ta | awk '$1 >= '^`{seconds '23 may 2011'}^' {print $2}'
  40. .EE
  41. .SH SEE ALSO
  42. .IR date (1),
  43. .IR du (1),
  44. .IR mtime (1),
  45. .IR ctime (2)
  46. .SH BUGS
  47. All-numeric dates, popular in the USA, are simply ambiguous,
  48. more so if the year is truncated to 2 digits.