blob: 6028fb483711aeecc65d21fbce8264b5e89f12b8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
---[[
LuCI http protocol implementation - date helper class.
This class contains functions to parse, compare and format http dates.
]]
module "luci.http.date"
---[[
Return the time offset in seconds between the UTC and given time zone.
@class function
@name tz_offset
@param tz Symbolic or numeric timezone specifier
@return Time offset to UTC in seconds
]]
---[[
Parse given HTTP date string and convert it to unix epoch time.
@class function
@name to_unix
@param data String containing the date
@return Unix epoch time
]]
---[[
Convert the given unix epoch time to valid HTTP date string.
@class function
@name to_http
@param time Unix epoch time
@return String containing the formatted date
]]
---[[
Compare two dates which can either be unix epoch times or HTTP date strings.
@class function
@name compare
@param d1 The first date or epoch time to compare
@param d2 The first date or epoch time to compare
@return -1 - if d1 is lower then d2
@return 0 - if both dates are equal
@return 1 - if d1 is higher then d2
]]
|