encode-date-and-timeDate and Timefull-date-and-timeencode-time-of-dayGoTo Top

encode-time-of-day   second minute hour &optional universal-time => universal-time[Function]

Purpose
Return a Universal Time representing a specified time-of-day.

Package   :gbbopen-tools (or :portable-threads if Portable Threads is used without GBBopen Tools)

Module   :gbbopen-tools (or :portable-threads if Portable Threads is used without GBBopen Tools)

Arguments and values

second     An integer between 0 and 59, inclusive
minute     An integer between 0 and 59, inclusive
hour     An integer between 0 and 23, inclusive
universal-time     A Universal Time (default is nil, which is equivalent to the value returned by (get-universal-time))

Description
If the specified time-of-date has already passed (relative to the universal-time value), the next day is assumed.

See also
    encode-date-and-time

Examples
Schedule a scheduled function that prints "It's quitting time!" every day at 5pm:

  > (schedule-function
      (make-scheduled-function
        #'(lambda (scheduled-function)
            (declare (ignore scheduled-function))
            (print "It's quitting time!"))
        :name 'quitting-time)
       (encode-time-of-day 0 0 17) :repeat-interval #.(* 24 60 60))
  >

Verbosely change quitting-time to 5:30pm every day:

  > (schedule-function 'quitting-time (encode-time-of-day 0 30 17)
      :repeat-interval #.(* 24 60 60)
      :verbose 't)
  ;; Unscheduling #<scheduled-function quitting-time [17:00:00]>...
  ;; Scheduling #<scheduled-function quitting-time [17:30:00]> 
  ;; as the next scheduled-function...
  >


The GBBopen Project


encode-date-and-timeDate and Timefull-date-and-timeencode-time-of-dayGoTo Top