[dev] timezone pref
Jon Parise
jon@csh.rit.edu
Thu, 17 May 2001 16:56:12 -0400
On Thu, May 17, 2001 at 10:14:16AM -0700, Max Kalika wrote:
> Would it make sense to default the timezone pref to:
>
> 'value' => sprintf("%s%d", date('T'), date('Z') / 60 / 60 * -1)
This produces 'EDT4' on my system. Is that valid? I thought
only 'EST5EDT' would be correct for my location.
> This way things can function smoothly even if the pref is not set. (At least
> this fixed my viewing/composing problems related to dates).
I was thinking of just doing:
Index: compose.php
===================================================================
RCS file: /cvs/horde/imp/compose.php,v
retrieving revision 2.296
diff -u -r2.296 compose.php
--- compose.php 2001/05/10 05:17:25 2.296
+++ compose.php 2001/05/17 20:54:37
@@ -334,7 +334,9 @@
}
/* Set the current time zone. */
-putenv('TZ=' . $prefs->getValue('timezone'));
+if (!empty($prefs->getValue('timezone'))) {
+ putenv('TZ=' . $prefs->getValue('timezone'));
+}
/* Run through the action handlers. */
switch ($actionID) {
Index: mailbox.php
===================================================================
RCS file: /cvs/horde/imp/mailbox.php,v
retrieving revision 2.264
diff -u -r2.264 mailbox.php
--- mailbox.php 2001/05/12 06:07:34 2.264
+++ mailbox.php 2001/05/17 20:54:37
@@ -128,7 +128,9 @@
}
/* Set the current time zone. */
-putenv('TZ=' . $prefs->getValue('timezone'));
+if (!empty($prefs->getValue('timezone'))) {
+ putenv('TZ=' . $prefs->getValue('timezone'));
+}
/* Run through the action handlers */
switch ($actionID) {
Index: message.php
===================================================================
RCS file: /cvs/horde/imp/message.php,v
retrieving revision 2.225
diff -u -r2.225 message.php
--- message.php 2001/05/16 16:36:35 2.225
+++ message.php 2001/05/17 20:54:37
@@ -214,7 +214,9 @@
$printer_friendly = false;
/* Set the current time zone. */
-putenv('TZ=' . $prefs->getValue('timezone'));
+if (!empty($prefs->getValue('timezone'))) {
+ putenv('TZ=' . $prefs->getValue('timezone'));
+}
/* Run through action handlers */
switch ($actionID) {
--
Jon Parise (jon@csh.rit.edu) . Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/ : Computer Science House Member