Changes between Version 2 and Version 3 of TimeUtils


Ignore:
Timestamp:
2010-03-16 03:49:10 (10 years ago)
Author:
javier_guerra
Comment:

add to_secs() function

Legend:

Unmodified
Added
Removed
Modified
  • TimeUtils

    v2 v3  
    1717  Returns the number of seconds since the last midnight to the given `time`.  If no `time` is given, assumes current time. 
    1818 
     19'''`timeutils.to_secs (timestring)`''' 
     20  Converts a string of the form `"hh:mm:ss am|pm"` to the number of seconds.  Together with `dayseconds()` it lets you write code of the form: 
     21{{{ 
     22if timeutils.dayseconds() < timeutils.to_secs ("09:30 pm") then 
     23    return false 
     24end 
     25}}} 
     26 
    1927'''`timeutils.localtoUTC ([time] [, timezone])`''' 
    2028  Returns the 'date table' (same as returned by `os.date('*t', time)`) of the UTC time corresponding to the given `time`.  If no `time` is given, assumes current time.  If no `timezone` is given, assumes Vera's configured timezone.