]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/forum/How_to_parse___34__:__47__etc__47__localtime__34___timezone__63__/comment_1_76d7e1f18828ce2767ba4f98a1901c29._comment
Added a comment
[git.ikiwiki.info.git] / doc / forum / How_to_parse___34__:__47__etc__47__localtime__34___timezone__63__ / comment_1_76d7e1f18828ce2767ba4f98a1901c29._comment
1 [[!comment format=mdwn
2  username="smcv"
3  avatar="http://cdn.libravatar.org/avatar/0ee943fe632ff995f6f0f25b7167d03b"
4  subject="comment 1"
5  date="2016-12-26T19:26:25Z"
6  content="""
7 `:/etc/localtime` is a glibc'ism, added to solve
8 [[bugs/without_timezone,_excessive_statting_causes_slowness]]. It means
9 \"read the contents or symlink destination of `/etc/localtime` and use that as
10 the active time zone\".
12 I would not recommend parsing that string, although you could.
14 ikiwiki sets the `TZ` environment variable to either `$config{timezone}`
15 or that default value during startup; so can't your plugin just use
16 local time unconditionally, via `time_zone => 'local'`, without ever
17 caring about which specific time zone that means?
19 (For example, the standard `IkiWiki::formattime` uses `localtime($time)` which
20 is basically a non-OO version of
21 `DateTime->from_epoch(epoch => $time, time_zone => 'local')`.)
22 """]]