aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-03-24 13:36:16 -0400
committerJoey Hess <joey@kitenet.net>2011-03-24 13:36:16 -0400
commit78c750f2d28f23e7cfc56890999bcd313cf711c7 (patch)
treedc5d21fba31bd53215250cc23cb51b498b3227d8 /IkiWiki.pm
parent76264920b0a4543577a69475d7ef88557554c135 (diff)
downloadikiwiki-78c750f2d28f23e7cfc56890999bcd313cf711c7.tar
ikiwiki-78c750f2d28f23e7cfc56890999bcd313cf711c7.tar.gz
Add timezone setting in setup file. This alows time zone to be configured via the web.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 9de25a4b3..1c05a7aa5 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -336,6 +336,14 @@ sub getsetup () {
safe => 0, # paranoia
rebuild => 0,
},
+ timezone => {
+ type => "string",
+ default => "",
+ example => "US/Eastern",
+ description => "time zone name",
+ safe => 1,
+ rebuild => 1,
+ },
include => {
type => "string",
default => undef,
@@ -529,6 +537,12 @@ sub checkconfig () {
$ENV{$val}=$config{ENV}{$val};
}
}
+ if (defined $config{timezone} && length $config{timezone}) {
+ $ENV{TZ}=$config{timezone};
+ }
+ else {
+ $config{timezone}=$ENV{TZ};
+ }
if ($config{w3mmode}) {
eval q{use Cwd q{abs_path}};