]> git.madduck.net Git - etc/awesome.git/blob - .config/awesome/modules/luatz/doc/index.md

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:

manipulate default sink with audio commands
[etc/awesome.git] / .config / awesome / modules / luatz / doc / index.md
1 ## `luatz`
2
3 Requiring the base luatz module will give you a table of commonly used functions and submodules.
4
5 The table includes the following sub modules, which have their own documentation:
6
7   - [`parse`](#parse): Parses common date/time formats
8   - [`timetable`](#timetable): Class for date/time objects supporting normalisation
9
10 ### `time()` <!-- --> {#luatz.time}
11
12 Returns the current unix timestamp using the most precise source available.
13 See [`gettime`](#gettime) for more information.
14
15
16 ### `now()` <!-- --> {#luatz.now}
17
18 Returns the current time as a timetable object
19 See `timetable` for more information
20
21
22 ### `get_tz([timezone_name])` <!-- --> {#luatz.get_tz}
23
24 Returns a timezone object (see `tzinfo` documentation) for the given `timezone_name`.
25 If `timezone_name` is `nil` then the local timezone is used.
26 If `timezone_name` is an absolute path, then that `tzinfo` file is used
27
28 This uses the local [zoneinfo database](https://www.iana.org/time-zones); 
29 names are usually of the form `Country/Largest_City` e.g. "America/New_York".
30 Check [wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for an example list.
31
32
33 ### `time_in(timezone_name[, utc_ts])` <!-- --> {#luatz.time_in}
34
35 Returns the current time in seconds since 1970-01-01 0:00:00 in the given timezone as a string,
36 (same semantics as [`get_tz`](#luatz.get_tz)) at the given UTC time (defaults to now).
37
38
39 ### `gmtime(ts)` <!-- --> {#luatz.gmtime}
40
41 As in the C standard library
42
43
44 ### `localtime(ts)` <!-- --> {#luatz.localtime}
45
46 As in the C standard library
47
48
49 ### `ctime(ts)` <!-- --> {#luatz.ctime}
50
51 As in the C standard library