timezone

Django template timezone in :date filter - is abbreviation possible?

If I write {{some_time|date:"h:i A T"}} in a django template, it outputs "12:00 AM Eastern Daylight Time". I would prefer the short timezone format "EDT". Any way you can do this? ...

How to get timezone hour offset and account for DST with PEAR::Date?

I am trying to get the offset hours from UTC, given a summer date. My system time is set to America/Los_Angeles. I have the following: require_once("Date.php"); $dateTZ = new Date_TimeZone('America/Los_Angeles'); echo $dateTZ->getOffset(new Date('2009-07-01 12:00:00'))/1000/60/60; This prints '-8'; shouldn't it show '-7'? echo $da...

Converting from globalized date/time format (maybe ISO8601) to SQL Server datetime type

Is there a string format to represent a datetime that SQL will be able to parse and convert into another offset (EST -> UTC for example). I have a string from the user such as: declare @p1 varchar(50); declare @utcDateTime datetime; set @p1 = "2009-06-26 14:30:00.000Z-4:00"; -- could be ISO8601 -- what do I do here to convert @p1? ...

Having Timezone problems with PHP and MySQL...

My server time is in GMT, and I do the following whenever someone comes online. // Set a default timezone $defaultTimeZone = 'America/Toronto'; // load the user, if they are online... $onlineUser = new user(); if (isset($_SESSION['user_id'])) { if ($onlineUser->loadUser($_SESSION['user_id'])) { $defaultTimeZone = $onlineUser->timeZ...

Dates in SQL Server consistently off by 12 hours

Our production platform technologies are these: PHP, MS SQL Sever, and IIS. PHP is set to the timezone 'Pacific/Auckland' which is current +12:00 GMT/UTC. When we retrieve dates from SQL Server, they are consistently 12 hours 'behind' what they should be, ie. SQL Server is storing and serving them as GMT dates, even though the time zon...

Django with system timezone setting vs user's individual timezones

How well does Django handle the case of different timezones for each user? Ideally I would like to run the server in the UTC timezone (eg, in settings.py set TIME_ZONE="UTC") so all datetimes were stored in the database as UTC. Stuff like this scares me which is why I prefer UTC everywhere. But how hard will it be to store a timezone ...

How can I know the Timezone of my Web site Host

Hi, I know this one is the weirdest of all weird questions I have asked till date. But I have a reason. The problem is that I have a no of websites hosted in diff servers (I dont own these servers) and every website has some pages where I have to enter some execution date and time. The date/time I enter should be of the timezone in wh...

PHP Startup: Timezone database is corrupt

Hi, I have juste updated my CentOS server. PHP is now at the 5.2.10 version (php-5.2.10-1.el5.remi.i386), and I have installed PECL Runkit. tzdata was updated too (tzdata-2009i-2.el5.noarch). Since the update, Apache refuse to start Here is the httpd/error.log [Wed Jul 08 11:40:21 2009] [notice] suEXEC mechanism enabled (wrapper: /us...

How to parse dates with -0400 timezone string in python?

I have a date string of the form '2009/05/13 19:19:30 -0400'. It seems that previous versions of python may have supported a %z format tag in strptime for the trailing timezone specification, but 2.6.x seems to have removed that. What's the right way to parse this string into a datetime object? ...

C#: Making sure DateTime.Now returns a GMT + 1 time

I am using DateTime.Now to show something according to today's date, and when working locally (Malta, Europe) the times appear correctly (obviously because of the Time Zone) but ofcourse when I upload it to my hosting server (USA), DateTime.Now does not represent the correct time zone. Therefore, in my code, how can I convert DateTime.N...

Setting/Changing an .NET application's TimeZone

Is there a way to set a .NET application's TimeZone to a value other than the OS's TimeZone? For instance, I am using my application on an OS with Central Standard Time set, and I would like the app to behave as if it were in Eastern Standard Time, without having to manually convert all DateTimes in my application using a method like ...

django-timezones

I am trying to setup django-timezones but am unfamiliar on how to go about this. The only info that I have found is here: http://www.ohloh.net/p/django-timezones class MyModel(Model): timezone = TimeZoneField() datetime = LocalizedDateTime('timezone') I also tried looking through the pinax code or any other projects that us...

How to get UTC value for SYSDATE on Oracle

Hello, Probably a classic... Would you know a easy trick to retrieve an UTC value of SYSDATE on Oracle (best would be getting something working on the 8th version as well). For now I've custom function :( Cheers, Stefan ...

Displaying a date with a custom timezone.

Lets say I have a string that represents a date that looks like this: "Wed Jul 08 17:08:48 GMT 2009" So I parse that string into a date object like this: DateFormat formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZ yyyy"); Date fromDate = (Date)formatter.parse(fromDateString); That gives me the correct date object. Now I wan...

Converting between timezones in C

Hello All, I need to convert time between timezones in C (on linux, so anything specific would do too). I know my current time, local and UTC, I have the offset of the target time. I am trying to use mktime, gmtime, localtime and similar set of functions but still can't figure it out. Thanks in advance. ...

how to add time in mysql query

i am using this query select date_time_posting from table where FROM_UNIXTIME(date_time_posting,'%d-%m-%Y')='$c_day_date' where $c_day_date is having dates in dd-mm-yy format like 25-07-2009 My server is in different time zone from mine.Total difference is of about 6 hours i.e. my local timezone is 6 hours ahead of my server timezone....

ASP.NET / SQL Timezone mystery

Setup: Windows Server 2003 / SQL Server 2005. ASP.NET 2.0. IIS 6. The site I'm working on uses ASP.NET Membership and when a user is created it is inserted into the aspnet_membership database. All servers are set at Central Time. I also verified this by doing a Select GetDate() on SQL Server and it returned central time. However, w...

Django ORM: time zone support

Hi, Can you recommend any implementation of Time Zones support for Django's ORM (DateTime filed)? Ideally it has to be DB-agnostic and transparent, allowing to use all standard ORM things like __lt, __gt etc. I guess it needs to store time in UTC plus local timezone. Thanks! ...

TSQL: How to convert local time to UTC? (SQLServer2008)

We are dealing with an application that needs to handle global time data from different time zones and daylight savings time settings. The idea is to store everything in UTC format internally and only convert back and forth for the localized user interfaces. Does the SQL Server offer any mechanisms for dealing with the translations given...

General way to manipulate the times (between timezones) in C ?

After writing a sample code for the question about converting between timezones, one of the comments to it was the need for more general method for converting from timezone A to timezone B. I was curious myself too to have a more high-level primitives for such a manipulations, so I wrote the below code. One drawback I see is that it con...