]>
git.madduck.net Git - etc/awesome.git/commitdiff
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
94c5a08 )
- [luasocket](http://w3.impa.br/~diego/software/luasocket/)'s `socket.gettime`
- [`os.time`](http://www.lua.org/manual/5.2/manual.html#pdf-os.time)
- [luasocket](http://w3.impa.br/~diego/software/luasocket/)'s `socket.gettime`
- [`os.time`](http://www.lua.org/manual/5.2/manual.html#pdf-os.time)
The library/function currently in use.
The library/function currently in use.
The smallest time resolution (in seconds) available from `gettime ( )` .
The smallest time resolution (in seconds) available from `gettime ( )` .
Returns the number of seconds since unix epoch (1970-01-01T00:00:00Z) as a lua number
Returns the number of seconds since unix epoch (1970-01-01T00:00:00Z) as a lua number
- `timetable`: Class for date/time objects supporting normalisation
- `timetable`: Class for date/time objects supporting normalisation
Returns the current unix timestamp using the most precise source available.
See `gettime` for more information.
Returns the current unix timestamp using the most precise source available.
See `gettime` for more information.
-## `get_tz ( [timezone_name] )`
+### `get_tz ( [timezone_name] )`
Returns a timezone object (see `tzinfo` documentation) for the given `timezone_name`.
If `timezone_name` is `nil` then the local timezone is used.
Returns a timezone object (see `tzinfo` documentation) for the given `timezone_name`.
If `timezone_name` is `nil` then the local timezone is used.
Check [wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for an example list.
Check [wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for an example list.
-## `time_in ( timezone_name [, utc_ts] )`
+### `time_in ( timezone_name [, utc_ts] )`
Returns the current time in seconds since 1970-01-01 0:00:00 in the given timezone as a string,
(same semantics as `get_tz`) at the given UTC time (defaults to now).
Returns the current time in seconds since 1970-01-01 0:00:00 in the given timezone as a string,
(same semantics as `get_tz`) at the given UTC time (defaults to now).
Functions take the source string and an optional initial postition.
Functions take the source string and an optional initial postition.
-## `rfc_3339 ( string [, init] )`
+### `rfc_3339 ( string [, init] )`
Returns a luatz timetable and the (optional) time zone offset in seconds
Returns a luatz timetable and the (optional) time zone offset in seconds
Equality and comparisons should work between timetable objects.
Equality and comparisons should work between timetable objects.
-## `new ( year , month , day , hour , min , sec , [yday] , [wday] )`
+### `new ( year , month , day , hour , min , sec , [yday] , [wday] )`
Returns a new timetable with the given contents.
Returns a new timetable with the given contents.
-## `new_from_timestamp ( timestamp )`
+### `new_from_timestamp ( timestamp )`
Returns a new (normalised) timetable, given a timestamp in seconds since the unix epoch of
1970-01-01.
Returns a new (normalised) timetable, given a timestamp in seconds since the unix epoch of
1970-01-01.
Returns a new independent instance of an existing timetable object.
Returns a new independent instance of an existing timetable object.
Mutates the current object's time and date components so that they lie within 'normal'
ranges e.g. `month` is `1`-`12`; `min` is `0`-`59`
Mutates the current object's time and date components so that they lie within 'normal'
ranges e.g. `month` is `1`-`12`; `min` is `0`-`59`
-## `:rfc_3339 ( )` and `__tostring` metamethod
+### `:rfc_3339 ( )` and `__tostring` metamethod
Returns the timetable formatted as an rfc-3339 style string.
The timezone offset (or Z) is not appended.
Returns the timetable formatted as an rfc-3339 style string.
The timezone offset (or Z) is not appended.
`:normalise ( )` should be called first.
`:normalise ( )` should be called first.
Returns the timetable as the number of seconds since unix epoch (1970-01-01) as a lua number.
Returns the timetable as the number of seconds since unix epoch (1970-01-01) as a lua number.
Unpacks the timetable object; returns `year`, `month`, `day`, `hour`, `min`, `sec`, `yday`, `wday`
Unpacks the timetable object; returns `year`, `month`, `day`, `hour`, `min`, `sec`, `yday`, `wday`
-## `:find_current ( utc_ts )`
+### `:find_current ( utc_ts )`
Returns the relevant `tt_info` object for the given UTC timestamp in the timezone.
Returns the relevant `tt_info` object for the given UTC timestamp in the timezone.
-## `:localise ( utc_ts )` and `:localize ( utc_ts )`
+### `:localise ( utc_ts )` and `:localize ( utc_ts )`
Convert the given UTC timestamp to the timezone.
Returns the number of seconds since unix epoch in the given timezone.
Convert the given UTC timestamp to the timezone.
Returns the number of seconds since unix epoch in the given timezone.
-## `:utctime ( local_ts )`
+### `:utctime ( local_ts )`
Convert the given local timestamp (seconds since unix epoch in the time zone) to a UTC timestamp.
This may result in ambigous results, in which case multiple values are returned.
Convert the given local timestamp (seconds since unix epoch in the time zone) to a UTC timestamp.
This may result in ambigous results, in which case multiple values are returned.