-
Notifications
You must be signed in to change notification settings - Fork 11
/
README
26 lines (19 loc) · 695 Bytes
/
README
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
nginx strftime module
=====================
Nginx module to write `strftime` formatted time to a nginx conf variable.
strftime year "%Y";
strftime date "%Y-%m-%d";
strftime local_time "%H:%M:%S";
strftime gmt_time "%H:%M:%S" gmt;
location /year {
return 200 "$year\n";
}
location /date {
strftime hours "%H";
strftime minutes "%M";
return 200 "It's $hours hours and $minutes minutes of $date\n";
}
location /hour {
return 200 "$gmt_time | $local_time of $date\n";
}
It should output "2011" for /year, "It's 09 hours and 34 minutes of 2011-10-02" for /date, and "12:34:56 | 09:34:56 of 2011-10-02" for /hour.