timezone

JRE clock is different (one hour ahead) than system date

Hello All, I have a windows server 2003 machine, installed on it, a cisco product called "Cisco Voice Portal", this product runs on JRE version 1_5_0_12. Getting the date/time either by: new Date(); or Calendar.getInstance(); always the date is one hour ahead of the system date. At first, i thought it is a timezone mismatch, howeve...

Shell script to find time zone offset from UTC

Is there a reliable way to find the UTC-offset of a given time zone in the shell? On my linux box, I can use TZ=[TIME ZONE] date +%z but I need to run this on HP-UX, and the %z option of date is not supported. I have a data file which has a number of timestamps (in UTC), and for each of them a timezone is indicated, and I need to find t...

time_select with 12 hour time and Time Zone in Ruby on Rails

I have the need to capture a time and time zone from users of a rails 2.3.8 app, but have been unable to think of a clean solution to create and parse the selections. Ideally I would have a drop-down menus for the following: hour (1-12) minute (0-59) AM/PM Time Zone Is there a gem/plugin that accomplishes what I am looking for? Will...

rails' utc_to_local and daylight savings time

> e = Event.first > e.registration_start_utc #registration_start_utc is a datetime column => Sat, 23 Oct 2010 06:38:00 UTC +00:00 > e.registration_start_utc.utc? => true > ActiveSupport::TimeZone.find_tzinfo("America/New_York").utc_to_local(e.registration_start_utc) => Sat, 23 Oct 2010 02:38:00 UTC +00:00 2 questions about this: ...

MS Outlook incorrectly interprets ICS files in local time: daylight savings time overcorrection

Does anyone know a way in an ICS file to specify that all times are written in the local time at the location? I thought that leaving the 'Z' off the end of times, and using the TZID="America/Denver" (for example) in DTSTART and DTEND lines accomplished this, but MS Outlook assumes that all times are in the location's standard time. My...

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...

What should I map a TimeZoneInfo property to a SQL Server 2008 DB Type?

Hi folks, I have a TimeZoneInfo property on some object which I need to save to a Microsoft SQL Server 2008 database. What type of database field type should I use, please? If it helps, I'm also using Entity Framework 4, which came with my Visual Studio 2010. ...

Detect if a date is in Daylight saving time in MySql

I have inherited a legacy application where all the dates and times are stored in the local timezone (UK). I am not in a position to change how these are stored. However, the requirement is to display all the dates in GMT within the app. Therefore when I retrieve a list of events from the database I need it to display them all in this ...

TimeZoneInfo|GetUtcOffset: A better solution?

Hi, I'm facing an issue wherein my server expects datetime objects in GMT format and my UI application always creates and manipulates all datetime objects according to local culture.I cannot change the culture as there are other functionalities which need the datetime objects to be according to the local format. I have written a convert...

Mysql default timezone

My server is in US, and I'm in istanbul. Problem is I want to ask mysql about current time. Is there a function to adjust it's time accourding to mine? select * from xyz where dateTimeField<now(); dateTimeField will available after 10 hours that it shoud be! ...

Time zone handling in php

I am working on rss parser project, I need to fetch URL from us based server and store the data in to database while storing/viewing I need to keep the post time. I am using simplepie for rss aggregation, I face the following problem while handling rss while I am checking rss url in firefox 3.0.19/system timezone set to Chennai/Kolkatt...

Convert all dates in PHP to local time.

The server my PHP script is running on is set to UTC. I can't seem to figure out a way to set all dates to the browser's timezone. All dates displayed are formatted using PHP's date() function. I know that via JavaScript's getTimezoneOffset() function, I can get the browser's current UTC offset (-4, in my case). How can I tell PHP to...

Rails timestamps don't use the right timezone

I'm a bit confused about timezones in rails. I want my rails app to use British Summer Time (like daylight savings in the US) for the timestamps set in updated_at and created_at in my models. I changed my environment.rb to say config.time_zone = 'London' The ubuntu server my app is on seems to use BST for it's time: in the comman...

Intercepting Date objects coming from BlazeDS and adjusting for timezone differences

I am working on an application that is near the end of its development cycle and has mostly passed user testing. We recently realized that having flex convert dates to the client's local timezone is not desired, as all of our dates are in EST and contain no time data. Since BlazeDS sends dates in UTC, this results in the dates being conv...

Getting the timezone from a Yahoo WOEID

I am using this question (yahoo-weather-api-woeid-retrieval) to convert a US ZIP to a Yahoo WOEID value. However while the Yahoo reply returns all sorts of interesting stuff, what I am interested in getting is the correct timezone of the location. Is there any easy way to return the timezone from Yahoo, or map a WOEID (or ZIP in that m...

PHP Timezones getTransitions trustworthy?

Have you ever had any issue with PHP timezones conversions through the getTransitions function? I am trying to convert an Argentinian date into GMT. If I look into the array of transitions, I get: .... [63] => Array ( [ts] => 1287284400 [time] => 2010-10-17T03:00:00+0000 [offset] => -7200 [isdst] => 1 [abbr] => ARST ) [64] => Array ( [...

How do I parse timezones from dates in python

Here's what I have tried so far. I'm just not too sure as to why it outputs as PST instead of GMT. I'm not sure if that's not the correct way to parse it, or to output it. Something seems to be wrong somewhere. >>> x = time.strptime('Wed, 27 Oct 2010 22:17:00 GMT', '%a, %d %b %Y %H:%M:%S %Z') >>> time.strftime('%a, %d %b %Y %H:%M:%S %Z...

unknown timezone name in R strptime/as.POSIXct

Where can I find a list of all legal time names for R function as.POSIXct? 'as.POSIXct("1970-01-01",tz="CST")' will generate warning that "CST" (Central Standard Time) is unknown. Thanks ...

Rails times oddness : "x days from now"

Hi all. when users sign up to one of my sites for a free trial, i set their account expiry to be "14.days.from_now". Then on the home page i show how many days they have remaining, which i get with: (user.trial_expires - Time.now)/86400 (because there are 86400 seconds in a day, ie 60 * 60 * 24) The funny thing is, this comes out ...

Arizona TimeZone Day Light Saving

I am trying to get current time in specific time zones. I tried following code. Calendar j = new GregorianCalendar(TimeZone.getTimeZone("US/Mountain")); j.setTimeInMillis(Calendar.getInstance().getTimeInMillis()); System.out.println(j.get(Calendar.HOUR_OF_DAY)+":"+j.get(Calendar.MINUTE)); TimeZone tz = TimeZone.getTimeZone("US/Mountain"...