I'm trying to run some statistics over the Stack Overflow data dump, and for that I would like to know the time zone for each user. However, all I have to go on is the completely free-form "location" string.
I'll stress that I'm only looking for an approximation of the time zone; of course, in general this is an unsolvable problem. Howe...
I'm writing a web based front end to a database (PHP/Postgresql) in which I need to store various dates/times. The times are meant to be always be entered on the client side in the local time, and displayed in the local time too. For storage purposes, I store all dates/times as integers (UNIX timestamps) and normalised to UTC. One partic...
Do TimeZoneInfo and Olson database use identical identificators for time zones?
I get timezone id from GeoNames service (which is based on Olson database) and want to retrieve day light saving information for that timezone.
...
Hi folks
I'm attempting to get a timezone of a user based on area code information that they provided. I discovered the following resource on maxmind:
http://geolite.maxmind.com/download/geoip/api/php/timezone/
I suspect that I could use this with another api that provides the state that an area code belongs to. I'm looking for a si...
Hi.
I need to force any time related operations to GMT/UTC, regardless the timezone set on the machine. Any convenient way to so in code?
To clarify, I'm using the DB server time for all operations, but it comes out formatted according to local timezone.
Thanks!
...
Can anyone recommend a way to determine the timezone that an email was sent from in C#?
Looking at the header information of an email includes information like:
Received: from mail-ew0-f211.google.com (123.85.219.211) by UKExchange
(10.1.10.99) with Microsoft SMTP Server id 1.2.345.6; Tue, 13 Apr 2010
14:26:24 +0100
Received: by ewy3...
An offshoot of http://stackoverflow.com/questions/172110/how-do-i-elegantly-print-the-date-in-rfc822-format-in-perl, but Windows specific.
On windows:
C:\> perl -MPOSIX
print strftime('%z', localtime()),"\n";
Yields:
Central Daylight Time
I was expecting:
-0500
As anyone would on a Linux system. How can I get th...
Do you know a web service that's able let's say get a full list of cities in the world
with names, short names like PAR for Paris and time zones?
Or at least query by city name: Paris -> timezone=+02:00, abbrev=PAR
Also, what I see here: http://www.earthtools.org/webservices.htm#timezone
offset
The number of hours offset from UTC dis...
For example, when I extract from a database a Date() variable, it contains a date with "+04:00" shift.
According to my locale's settings.
So, UTC time is "ourTime" MINUS 4 hours.
Then, a user tells where he/she is from. Now, we need to save his/her shift.
LET'S SAY it is -01:00.
And finally, this user tells us where's he/she is headin...
Following from my last question which @Jon Skeet gave me a lot of help with (thanks again!)
I am now wondering how I can safely work with date/times, stored as UTC, when they are converted back to Local Date/Time.
As Jon indicated in my last question using DateTimeOffset represents an instant in time and there is no way to predict wha...
I am storing activity entries in a MySQL table. The table has a date_created field of type timestamp and through PHP I insert the activity entries based on GMT:
$timestamp = gmdate("Y-m-d H:i:s", time());
This works fine. On my client I am on GMT+2. If it is 16:00 here and I insert an entry, it is stored in MySQL as 14:00. This is as ...
If I convert a UTC datetime to swedish format, summertime is included (CEST). However, while creating a datetime with sweden as the timezone, it gets CET instead of CEST. Why is this?
>>> # Modified for readability
>>> import pytz
>>> import datetime
>>> sweden = pytz.timezone('Europe/Stockholm')
>>>
>>> datetime.datetime(2010, 4, 20, 1...
I am in Albuquerque, NM. I am trying to update some stamps every time I put an entry into a database.
Here is what I use.
date_default_timezone_set("US/Mountain");
$stamp =mktime();
//$stamp = gmmktime();
$time = date("H:i:s",$stamp);$date = date("Y-m-d",$stamp);
My local time is 12:15 PM but what I get is 18:15PM instead.
If you...
Each of my users has a (possibly) different TZ defined in their .bashrc. I have a Perl script that displays date/time and want it to have it display with their profile time zone.
Does anyone know the best way to do this?
...
What happens if #setDefault(TimeZone timezone) is called by a concurrent application running on the same application server with JDK 1.6
As discussed in TimeZone #setDefault changes in JDK 6 the call now changes VM wide, this can have horrible consequences.
If you're not adminsitrating the application server, how to ensure TimeZone doe...
I need to convert an existing (datetime fields) db from local time ut UTC.
The values are stored ad datetimes on a server with time zone CET (+1) (with summertime +2). When selecting data I use UNIX_TIMESTAMP(), which magically compensates for everything, ie, time zone shift and dst (if i've read the docs right).
I'm moving the db to a...
I know there's a much better and correct way to do it, but i need a temporarily solutions. I need to add in extra hours to the time, and the day will change automatically too. How should I change the code below?
package {
public class getTime {
private var today:Date=new Date();
private var hour:uint=today.getHours();
privat...
In my drupal installation I can get the offset from UTC in seconds to the timezone I specified in the admin panel using
variable_get('date_default_timezone', 0)
However, now that we have daylight-saving-time, the time I get is always off by one hour. Is there a way to retrieve the actual timezone string from Drupal, as "Europe/Berlin...
UPDATE: Ok, I didn't formulate a good Q to be answered. I still struggle with heroku being on -07:00 UTC and I at +02:200 UTC.
Q: How do I get the log written in the correct Time.zone ?
The 9 hours difference, heroku (us west) - norway, is distracting to work with. I get this in my production.log (using heroku logs):
Processing Pro...
I want to compare UTC timestamps from a log file with local timestamps. When creating the local datetime object, I use something like:
>>> local_time=datetime.datetime(2010, 4, 27, 12, 0, 0, 0,
tzinfo=pytz.timezone('Israel'))
I want to find an automatic tool that would replace thetzinfo=pytz.timezone(...