utc

UTC support for comparing 2 files date/time

I have a utility that compares a source and destination file date/time. This works in most cases but fails when comparing date/time for files in different time zones. So I need a UTC datetime routine. From looking around it seems the Windows API GetFileTime will support this. I also found this wrapper procedure, but it crashes on the...

How to get the right timezone(server timezone) from the UTC date format

As follow up of the below link. http://stackoverflow.com/questions/3215508/how-to-format-this-date-type-2010-06-24t000000z-to-sun-24-06-10-7-15-p-m-cdt I'm converting the utc date format to simple date format. 2010-06-24T00:00:00Z to sun,24/06/10 7.15 p.m (CDT) (converted time) But is there a way to identify the valid timezone, as t...

MYSQL query / dates older than 1 week ago (all datetimes in UTC)

Hi, How do I query a mysql db to return all records with a datetime older than 1 week ago. Note that the datetime table stores everything in UTC, and i should be comparing it in that itself... Jusst to be clear - I'm looking for a pure mysql query ...

Formatting Dates and DateTimes for User's timezone including Timezone Offset in C# (.net)

I am working on a C# application and want to display dates so they are local to the user's timezone. We have the user's timezone setting stored in the database, and all dates are stored in the database in UTC which should make this simple. The trick is that I also need to display the timezone offset for each date localized for the user.....

Parsing Datetime

I have a date time as a string, eg. "2010-08-02", I'm trying to convert it to UTC with the following code snippet DateTime.ParseExact("2010-08-02Z", "yyyy-MM-ddZ", CultureInfo.InvariantCulture) When I print to the console, I get the following: 8/1/2010 5:00:00 PM. Is there a reason why the date shows up as the date before the date I'm...

PHP return JS UTC date format

Is there any way I can return a date using PHP that is the same format that Date.UTC(y,m,d) returns? Here is an example of the format I need: 1274745600000 (Apr 25, 2010) ...

Javascript: Convert a UTC Date() object to the local timezone

Hey, I have a Date() object that contains a UTC date, which I need converted to the users local timezone. Does anybody know how I could do this? :-) Thanks in advanced! ...

NSDate formatting issues.

I am getting a headache from dealing with the data format, particulary the time offset components. I retrieve a DateTime field from sqlite3 and temporarily store it in a const char*. I convert this into an NSString*. I conver the NSString* to a NSDate. Now, before, I was using a date format something like this: "MM/dd/YYY hh:mm -0700...

a days's worth of data in diff local times

I have a winform client and wcf service that together display historical data. the data stored in the db with utc timestamps. If two clients in different time zones want to look at a most recent day's worth of data based on their local time, can it be possible that they would be looking at different sets of data? ...

php DateTime timezone for Columbus Ohio

Columbus, Ohio is in EDT timezone but PHP::DateTime uses these php timezones and I cannot seem to find one that gives me correct time. America/New_York is off by an hour because until EDT ends we are +5 not 4. I am confused. For example right now its 11:26AM roughly speaking and I get back 10:26AM. The server has the right time set...

parsing of date/time from string (boost?)

I'm kinda stuck with parsing of date/time strings. Help would be greatly appreciated. Input: strings with date and optional time. Different representations would be nice but necessary. The strings are user-supplied and can be malformed. Examples: - "2004-03-21 12:45:33" (I consider this the default layout) - "2004/03/21 12:45:33" (o...

Store UTC date time in database

I will convert all date & time input by user (local time) to UTC and store it in database. When display back I will convert UTC time to their time zone which is set in their profile. Is it good? ...

pytz and Etc/GMT-5

I'm having trouble understanding the conversion between the "Etc/GMT-5" timezone and UTC in pytz. >>> dt = datetime(2009, 9, 9, 10, 0) # September 9 2009, 10:00 >>> gmt_5 = pytz.timezone("Etc/GMT-5") >>> gmt_5.localize(dt) datetime.datetime(2009, 9, 9, 10, 0, tzinfo=<StaticTzInfo 'Etc/GMT-5'>) Everything is fine so far, but then I try...

Joda Time: Convert UTC to local

I want to convert a Joda Time UTC DateTime object to local time. Here's a laborious way to do it which seems to work. But there must be a better way. Here's the code (in Scala) without surrounding declarations: val dtUTC = new DateTime("2010-10-28T04:00") println("dtUTC = " + dtUTC) val dtLocal = timestampLocal(dtUTC) ...

Get the GMT time given date and UTC offset in python

I have a date string of the following format '%Y%m%d%H%M%S' for example '19981024103115' and another string of the UTC local offset for example '+0100' What's the best way in python to convert it to the GMT time So the result will be '1998-10-24 09:31:15' ...