timezone

Python timezones - pytz.common_timezones has too many

There are way too many overlapping timezones in pytz's common list. Has anyone pared this down? For example there are 5 or 6 duplicate Canadian timezones and 15 or so duplicate US time zones. China is 1 timezone no DST, but has 5 entries.. By duplicate I mean GMT offset and DST are exactly the same. Getting rid of the timezones in pytz...

Are UtcNow and Now the same datetime? Do they know they're different?

If I run a snippet like: bool areTheyTheSame = DateTime.UtcNow == DateTime.Now what will I get? Does the DateTime returned know its timezone such that I can compare? My specific problem is that I'm trying to build a cache-like API. If it takes a DateTime AbsoluteExpiration, do I have to enforce that users of my API know whether t...

TimeZone problems using Lotus Java/CORBA session.createDateTime(Calendar)

I am attempting to create Domino DateTime objects in arbitrary time zones using the Lotus Java/CORBA classes. I appear to be successful for all time zones which have a base offset which is an integer number of hours. For fractional time zones, notably half-hour ones like Iran, India and Sri Lanka, or even less common ones like Nepal wi...

PostgreSQL: Aliases for "timestamp with time zone" and "at time zone"

I happen to have tables with timestamp without time zone column in my database. Now I need to compare them with respect to time zone. I can do it like: select my_timestamp::timestamp with time zone at time zone 'EST5EDT' from my_table where my_timestamp >= '2010-07-01'::timestamp at time zone 'EST5EDT' and my_timestamp < '20...

Need a method to convert a date from server's timezone to user's timezone

I need a method which could convert a given date from one time zone to another. Something like: Date Format: 2010-07-13 12:34:00 $newDestinationDate = $convertTimeZoneDate($dateTime, $serverTimeZone, $userTimeZone) Please help? ...

Timezones in MySQL

I'm playing with timezones in MySQL. I need to assign people to timezones, and so I looked in mysql.time_zone_data. Australia seems to have 5 independent timezones [1], so why does mysql.time_zone_data have 23 options? Australia/ACT Australia/Adelaide Australia/Brisbane Australia/Broken_Hill Australia/Canberra Australia/Currie Austral...

How should I determine next daylight saving time (DST) transition for a timezone in Perl?

I'm working on a world clock web application, and I'd like to add a function to note how and when each location will next undergo a DST change. I'm using the DateTime and DateTime::Timezone CPAN modules, which seem to provide every conceivable function apart from this one! DateTime::Timezone is an implementation of the tz/Olson database...

Current Time of Timezone

I have differents timezones and his GMT and DST. Example: TimeZoneId GMT offset 1. Jan 2010 DST offset 1. Jul 2010 America/Adak -10.0 -9.0 America/Anchorage -9.0 -8.0 America/Anguilla -4.0 -4.0 America/Antigua -4.0 -4.0 America/Araguaina -3.0 -3.0 This timezones...

Rails/Activerecord database field timezone

I have a database that is written to by a non-rails application and read from by a rails application. There is a datetime field in the database and the data stored in this field is stored in Eastern Time. In my rails app, I understand I can set the application's timezone in my environment.rb file by doing config.time_zone = 'Eastern Time...

How to sort an event table by time (have different timezones)?

I have a table that is structured the following way (that i can't change): EventName, LocalTime, Timezone Data would be something like this: Event1, 10:00, ET Event2, 11:00, ET Event3, 12:00, ET Event4, 10:00, CT how can i write a sql to sort this by actual time so result would be like: Event1, 10:00, ET Event2, 11:00, ET Event4, 1...

Obtaining Time zone in android

Is there a way to obtain the time zone from the callbacks received void onLocationChanged(Location location) using the time information that can be obtained from the location parameter long Time = location.getTime(); Or if there is another way please provide info! ...

An api to get actual time for asp.net

My server clock is running slow for some reason. I need to put a timestamp on my database transactions and need a reliable time source. Is there an api to the world time zone site or something similar? ...

convert timezone identifier to name? (Asia/Calcutta to Indian Standard Time)

I am working on a php (codeigniter) project. I have been doing a lot of work in timezones to convert times between different timezones and the server timezone. I know how to convert a php timezone identifier to its abbreviation (like Asia/Calcutta to IST). But now, I need the expansion of this abbreviation (Indian Standard Time). Is th...

Convert Office Hours to local time using JavaScript

How can I use JavaScript to add a message like this to a web page: Our office hours are 9am - 5pm (09:00 - 17:00) PST. In your timezone, that's WWxx - YYzz (AA:00 - BB:00). Where: "WW" and "YY" are converted to the proper values for "hour" (on the 12 hour clock). "xx" and "zz" are converted to either "am" or "pm". "AA" and "...

Convert string timestamp (with timezone offset) to local time. . ? python

I am trying to convert a string timestamp into a proper datetime object. The problem I am having is that there is a timezone offset and everything I am doing doesn't seem to work. Ultimately I want to convert the string timestamp into a datetime object in my machines timezone. # string timestamp date = u"Fri, 16 Jul 2010 07:08:23 ...

PHP: Need a opposite method of timezone_name_from_abbr?

I need an exactly opposite method of timezone_name_from_abbr(): http://php.net/manual/en/function.timezone-name-from-abbr.php I have a list of timezones name like: Australia/Brisbane Australia/Hobart Asia/Vladivostok Australia/Lord_Howe Asia/Magadan Asia/Kolkata America/Los_Angeles ...... I need method which will take timezone as a p...

Java date handling: store date, time and timezone in a single class

Does there exist a Java class, either in the standard libraries or third party, that allows one to store the date, time in millisecond accuracy and the timezone of the time within the same object? The features I need: Store a date, time with at least millisecond accuracy and the timezone Parse string date representations (e.g. "20...

Timing compare in SQL Server 2008

Hi All. How to compare Indian time with world's other country times in SQL Server 2008? Means i want to know if in India its mid night 1 am what will be timing in other countries through SQL Server 2008 ...

How can I map non-English Windows timezone names to Olsen names in Python?

If I call win32timezone.TimeZoneInfo.local().timeZoneName, it gives me the time zone name in the current locale (for example, on a Japanese machine, it returns u"東京 (標準時)"). I would like to map this name to an Olsen database timezone name for use with pytz. CLDR windowZones.xml helps me to map English names, but can't handle the Japanes...

Is this a dangerous override for Date.today in Ruby (on Rails)? (Timezone)

class Date class <<self alias_method :broke_ass_today, :today end def self.today Time.zone.now.to_date rescue Date.broke_ass_today end end because I would really hate to replace Date.today with that statement everywhere in our code base... that and its just much simpler write (and read) date Date.today, because that's...