» tagged pages
» logout

(Feed found, click Add Page to syndicate.) Error finding feed, please try again » Find feed title

A Blog Page allows you to add entries, for news or other time sensitive postings

(Login required to save to your tagged pages.)
(or Cancel)

Make further edits, (or Cancel)

(Login required to save to your tagged pages.)
(or Cancel)

(Editing anonymously: to be credited for your changes, login or register a new account)

Change Page Permissions? Changing these permissions will adjust who can modify this page.

Anonymous (change)
Swik Users (change)
(or Cancel)
Upload an image from your computer:
or Copy an image from a URL:
or Erase the current icon:
Icon Preview:

or Cancel

Erase timezone? The contents of timezone page and all pages directly attached to timezone will be erased.

or Cancel

(Editing anonymously: to be credited for your changes, login or register a new account)

other page actions:
timezone

timezone

Tags Applied to timezone

No one has tagged this page.

timezone Wiki Pages

c# Ajay Bharadwaj KN

sorted by: recent | see : popular
Content Tagged timezone

Pear::Date Returned Timezone is Wrong

Background Knowledge


I’m trying to determine the difference in minutes between two timestamps. I’m using Pear::Date to do this. The issue comes into play when I noticed that the wrong timezone was being used by Pear::Date, UTC. If I do not use Pear::Date the timezone is set correctly.

I have tried using date_default_timezone_set() and it does set the timezone back, however I feel this shouldn’t be necessary as the default timezone should be used. I have been using date_default_timezone_get() to determine what timezone is being used.

It’s my understanding that Pear::Date uses UTC when it is unable to determine the default timezone. As far as I know I have the default timezone set correctly and with a valid ID (see below). I was able to determine that the timezone changed from my default timezone to UTC after I used Date::setFromDateDiff(). This does not seem right at all.

I have checked the following.

  • Pear v1.7.2 stable
  • Pear::Date v1.4.7 stable
  • php.ini (default timezone) - date.timezone = “Canada/Saskatchewan”
  • phpinfo() - Correct configure file being loaded, /var/www/conf/php.ini.
  • phpinfo() - Under Date, date/time support is enabled.
  • phpinfo() - Default timezone - Canada/Saskatchewan
  • phpinfo() - date.timezone - Canada/Saskatchewan / Canada/Saskatchewan

PHP Code Test Case


1
2
3
4
5
6
7
8
9
require_once("Date.php");
 
$obFirstDate = new Date('20081014155640');
$obSecondDate = new Date(date("YmdHis",time()));
 
$obDateSpan = new Date_Span();
$obDateSpan->setFromDateDiff($obFirstDate, $obSecondDate);
echo (int)$obDateSpan->toMinutes();
echo "<br />".date_default_timezone_get();

Solution - Unknown


Does anyone have any suggestions where to look or what to do to fix this problem?

ShareThis

MySQL: Planet MySQL

EarthTools: Webservices

This service responds with the time zone and local time at the given latitude and longitude.

XML: del.icio.us/tag/xml

This should *never* happen!

While playing around with the great MySQL Activity Reporter , I ran into the following error.

[client 192.168.254.72] PHP Fatal error: strftime() [function.strftime]: Timezone database is corrupt - this should *never* happen! in /var/lib/mysqlard/mysqlar.php on line 62

Now the error is clear .. the Timezone database is corrupt and I`m the one to blame for .. this was on a pretty stripped down Centos that lives in UTC. So there wasn't a real Timezone database.

Obviously a quick apt-get install tzdata solved the problem, but once again the lesson is.. don't strip too much .. you'll eventually endup needing those 3 Kb of free space you gained anyhow.

MySQL: Planet MySQL

All About Interop : Date and Time Values and Java Interop: a concrete example using XStream

Last month I posted on Date and Time values and interop. One of the key points I made is that you can lose information (specifically timezone information) when you transition from .NET to something else. If you stay within .NET, then you don't lose that information, even if you serialize to XML and then de-serialize. If you transition outside of .NET, then you may lose information.

xstream: del.icio.us/tag/xstream

Page 1 | Next >>
Username:
Password:
(or Cancel)