time.texi 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. @node POSIX time
  2. @section Time
  3. A @dfn{time} record contains an integer that represents a time as the
  4. number of seconds since the Unix epoch (00:00:00 GMT, January 1, 1970).
  5. These procedures for operating on time records are in the structures
  6. @code{posix-time} & @code{posix}.
  7. @deffn procedure make-time seconds @returns{} time
  8. @deffnx procedure current-time @returns{} time
  9. @deffnx procedure time? object @returns{} boolean
  10. @deffnx procedure time-seconds time @returns{} integer
  11. @code{Make-time} & @code{current-time} construct time records;
  12. @code{make-time} uses the number of seconds that is its argument, and
  13. @code{current-time} uses the current number of seconds since the epoch.
  14. @code{Time?} is the disjoint type predicate for time objects.
  15. @code{Time-seconds} returns the number of seconds recorded by
  16. @var{time}.
  17. @end deffn
  18. @deffn procedure time=? time@suba{a} time@suba{b} @returns{} boolean
  19. @deffnx procedure time<? time@suba{a} time@suba{b} @returns{} boolean
  20. @deffnx procedure time<=? time@suba{a} time@suba{b} @returns{} boolean
  21. @deffnx procedure time>? time@suba{a} time@suba{b} @returns{} boolean
  22. @deffnx procedure time>=? time@suba{a} time@suba{b} @returns{} boolean
  23. Various time comparators. @code{Time=?} returns true if its two
  24. arguments represent the same number of seconds since the epoch.
  25. @code{Time<?}, @code{time<=?}, @code{time>?}, & @code{time>=} return
  26. true if their arguments are monotonically increasing, monotonically
  27. non-decreasing, monotonically decreasing, or monotonically
  28. non-increasing, respectively.
  29. @end deffn
  30. @deffn procedure time->string time @returns{} string
  31. Returns a string representation of @var{time} in the format of
  32. @code{"@var{DDD} @var{MMM} @var{HH}:@var{MM}:@var{SS} @var{YYYY}"}.
  33. For example,
  34. @lisp
  35. (time->string (make-time 1234567890))
  36. @result{} "Fri Feb 13 18:31:30 2009"@end lisp
  37. @strong{Note:} The string has a newline suffix.
  38. @end deffn