forked from hltbra/strftime-nginx-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Roycohen/strftime-nginx-module
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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; strftime gmt_time "%H:%M:%S" gmt "arg_timestamp"; # Getting from variable called timestamp. strftime gmt_time "%H:%M:%S" gmt 144567890; # Getting from timestamp. 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.
About
Nginx module to write `strftime` formatted time to a nginx conf variable
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- C 100.0%