Document `localtime` and `strflocaltime`
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Nicolas Williams · committed by Nicolas Williams · parent 06f2060 · Browse files · 2 files·+23 added−15 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+23 added−15 removed
- other:+23 added−15 removed
Provenance
- Commit
27c29ae- Tree
ac9a8aa- Author
Nicolas Williams <nico@cryptonector.com>- Committer
Nicolas Williams <nico@cryptonector.com>- Parent
06f2060
2 files changed+23 added−15 removed
modified:docs/content/3.manual/manual.yml+17 added-12 removed
1844 unmodified lines1845 The `now` builtin outputs the current time, in seconds since1846 the Unix epoch.1847 1848 Low-level jq interfaces to the C-library time functions are1849- also provided: `strptime`, `strftime`, `mktime`, and `gmtime`.1850- Refer to your host operating system's documentation for the1851- format strings used by `strptime` and `strftime`. Note: these1852- are not necessarily stable interfaces in jq, particularly as1853- to their localization functionality.1849+ also provided: `strptime`, `strftime`, `strflocaltime`,1850+ `mktime`, `gmtime`, and `localtime`. Refer to your host1851+ operating system's documentation for the format strings used1852+ by `strptime` and `strftime`. Note: these are not necessarily1853+ stable interfaces in jq, particularly as to their localization1854+ functionality.1855 1856 The `gmtime` builtin consumes a number of seconds since the1857 Unix epoch and outputs a "broken down time" representation of1857- time as an array of numbers representing (in this order): the1858- year, the month (zero-based), the day of the month, the hour1859- of the day, the minute of the hour, the second of the minute,1860- the day of the week, and the day of the year -- all one-based1861- unless otherwise stated.1858+ Greenwhich Meridian time as an array of numbers representing1859+ (in this order): the year, the month (zero-based), the day of1860+ the month, the hour of the day, the minute of the hour, the1861+ second of the minute, the day of the week, and the day of the1862+ year -- all one-based unless otherwise stated.1863 1864+ The `localtime` builtin works like the `gmtime` builtin, but1865+ using the local timezone setting.1866+1867 The `mktime` builtin consumes "broken down time"1868 representations of time output by `gmtime` and `strptime`.1869 1870 The `strptime(fmt)` builtin parses input strings matching the1871 `fmt` argument. The output is in the "broken down time"1872 representation consumed by `gmtime` and output by `mktime`.1873 1870- The `strftime(fmt)` builtin formats a time with the given1871- format.1874+ The `strftime(fmt)` builtin formats a time (GMT) with the1875+ given format. The `strflocaltime` does the same, but using1876+ the local timezone setting.1877 1878 The format strings for `strptime` and `strftime` are described1879 in typical C library documentation. The format string for ISO1880 8601 datetime is `"%Y-%m-%dT%H:%M:%SZ"`.1251 unmodified linesmodified:jq.1.prebuilt+6 added-3 removed
2030 unmodified lines2031 .P2032 The \fBnow\fR builtin outputs the current time, in seconds since the Unix epoch\.2033 .2034 .P2035-Low\-level jq interfaces to the C\-library time functions are also provided: \fBstrptime\fR, \fBstrftime\fR, \fBmktime\fR, and \fBgmtime\fR\. Refer to your host operating system\'s documentation for the format strings used by \fBstrptime\fR and \fBstrftime\fR\. Note: these are not necessarily stable interfaces in jq, particularly as to their localization functionality\.2035+Low\-level jq interfaces to the C\-library time functions are also provided: \fBstrptime\fR, \fBstrftime\fR, \fBstrflocaltime\fR, \fBmktime\fR, \fBgmtime\fR, and \fBlocaltime\fR\. Refer to your host operating system\'s documentation for the format strings used by \fBstrptime\fR and \fBstrftime\fR\. Note: these are not necessarily stable interfaces in jq, particularly as to their localization functionality\.2036 .2037 .P2038-The \fBgmtime\fR builtin consumes a number of seconds since the Unix epoch and outputs a "broken down time" representation of time as an array of numbers representing (in this order): the year, the month (zero\-based), the day of the month, the hour of the day, the minute of the hour, the second of the minute, the day of the week, and the day of the year \-\- all one\-based unless otherwise stated\.2038+The \fBgmtime\fR builtin consumes a number of seconds since the Unix epoch and outputs a "broken down time" representation of Greenwhich Meridian time as an array of numbers representing (in this order): the year, the month (zero\-based), the day of the month, the hour of the day, the minute of the hour, the second of the minute, the day of the week, and the day of the year \-\- all one\-based unless otherwise stated\.2039 .2040 .P2041+The \fBlocaltime\fR builtin works like the \fBgmtime\fR builtin, but using the local timezone setting\.2042+.2043+.P2044 The \fBmktime\fR builtin consumes "broken down time" representations of time output by \fBgmtime\fR and \fBstrptime\fR\.2045 .2046 .P2047 The \fBstrptime(fmt)\fR builtin parses input strings matching the \fBfmt\fR argument\. The output is in the "broken down time" representation consumed by \fBgmtime\fR and output by \fBmktime\fR\.2048 .2049 .P2047-The \fBstrftime(fmt)\fR builtin formats a time with the given format\.2050+The \fBstrftime(fmt)\fR builtin formats a time (GMT) with the given format\. The \fBstrflocaltime\fR does the same, but using the local timezone setting\.2051 .2052 .P2053 The format strings for \fBstrptime\fR and \fBstrftime\fR are described in typical C library documentation\. The format string for ISO 8601 datetime is \fB"%Y\-%m\-%dT%H:%M:%SZ"\fR\.2054 .1274 unmodified lines