Changes between Version 1 and Version 2 of TimeUtils
- Timestamp:
- 2010-02-26 20:21:32 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TimeUtils
v1 v2 11 11 12 12 13 '''`timeutils.lastmidnight ([time])` ::'''13 '''`timeutils.lastmidnight ([time])`''' 14 14 Returns the timestamp of the last midnight equal or preceding the given `time`. If no `time` is given, assumes current time. 15 15 16 '''`timeutils.dayseconds ([time])`''' ::16 '''`timeutils.dayseconds ([time])`''' 17 17 Returns the number of seconds since the last midnight to the given `time`. If no `time` is given, assumes current time. 18 18 19 '''`timeutils.localtoUTC ([time] [, timezone])`''' ::19 '''`timeutils.localtoUTC ([time] [, timezone])`''' 20 20 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. 21 21 22 '''`timeutils.degrees (x [, ...])`''' ::22 '''`timeutils.degrees (x [, ...])`''' 23 23 Transforms one or more numbers expressing an angles in degrees into strings with degrees, minutes and seconds. For example: 24 24 {{{ … … 27 27 }}} 28 28 29 '''`timeutils.sun_position ([time] [, place])`''' ::29 '''`timeutils.sun_position ([time] [, place])`''' 30 30 Returns sun's altitude and azimuth, in degrees, for the given `time` and `place`. If no `time` is given, assumes current time. The `place` parameter, if given, must be a table with `latitude`, `longitude` and `timezone` fields. If no `place` is given, uses the global `luup` table, which should have those fields. 31 31 32 '''`timeutils.is_dark ([ ime] [, place])`'''::32 '''`timeutils.is_dark ([time] [, place])`''' 33 33 Returns a boolean indicating if the sun is below the horizon.