timezone

What could cause this SimpleDateFormat formatting error?

I have a date stored as a java.sql.Timestamp in a database. The date is "2010-01-20T19:10:35.000Z" and is equivalent to 1264014635743 ms. Somehow, the date is formatted differently on the prod machine compared to the dev machine. The code to format the date is: private final static String DATE_FORMAT = "yyyy-MM-dd"; public final stati...

Is there timezone offset bug in ruby on rails?

I'm in Korea. Rails version is 2.3.5 in my environment, config.time_zone = 'Seoul' config.active_record.default_timezone = 'Seoul' created_at and updated_at value is inserted with local time in database. but, when I access model.created_at or model.updated_at, the value is understanding with UTC +9:00 So, I insert model to da...

Get localized date time string and time zone name in differnet languages on windows.

Is there any windows API or language feature (C++,C#) to get the time, date and time zone name in localized format for different languages? EDIT: In C# I can get the localized strings for date and time, but it seems TimeZoneInfo doesn't have localized strings. I also didn't find it in the registry. Most probably you need to translate ti...

Make timezone dropdown list populate with available timezones on a per Country basis?

I just noticed something really nice on the Google Analytics signup page for adding a new domain. First you pick a country them you pick your timezone. Instead of showing a huge Timezone list though they populate the timezone list with only timezones that are available for the country you have selected. I think this is a great idea t...

ActiveRecord model with datetime stamp with timezone support attribute.

Rails is great that it will support timezone overall in the application with Time.zone. I need to be able to support the timezone a user selects for a record. The user will be able to select date, time, and timezone for the record and I would like all calculations to be done with respect to the user selected timezone. My question is wha...

How to return my current time zone in RoR?

When I use return the time that the record created, it show this : 2010-01-20 15:04:40 UTC but I want the time in my specify time zone, for example, China. Is there any convenient method in RoR? ...

how do you deal with timezone issues?

Hello, For a scheduling system, what's the best way to save the timezone of client/event in a central server database coming from multiple sources mobile,web,client app. How do you store the dates? Alarms, reminders etc... How do you handle the DST setting? How do you handle the events if client has traveled to a different locat...

how to find time at particular timezone from anywhere

I need to know the current time at CDT when my Python script is run. However this script will be run in multiple different timezones so a simple offset won't work. I only need a solution for Linux, but a cross platform solution would be ideal. ...

How do you detect a website visitor's country (Specifically, US or not)?

I need to show different links for US and non-US visitors to my site. This is for convenience only, so I am not looking for a super-high degree of accuracy, and security or spoofing are not a concern. I know there are geotargeting services and lists, but this seems like overkill since I only need to determine (roughly) if the person is...

What timezone does MySQL TIMESTAMP columns use ON UPDATE?

Does it use the server timezone or UNIX_TIMESTAMP (UTC) ? And how do I get the current time in PHP, in the same timezone as MySQL's TIMESTAMP columns? ...

python-tz am I wrong or it's a bug

Hi Guy, It's a bit weird it seems that when I want to get a timezone for Europe/Paris with pytz it gets me to the PMT timezone instead of GMT+1 when it seems to work for Europe/Berlin. Not clear ? Well look at this snippet : #!/usr/bin/python import os import datetime from pytz.tzfile import build_tzinfo base='/usr/share/zoneinfo/' t...

TimeZone.setDefault changes in JDK6

Hello I just noticed that JDK 6 has a different approach to setting a default TimeZone than JDK5. Previously the new default would be stored in a thread-local variable. With JDK6 (I just reviewed 1.6.0.18) the implementation has changed, so that if the user can write to the "user.timezone" property, or if there is no SecurityManager i...

How can I change the timezone of a datetime value in Perl?

Using this function: perl -e 'use Time::Local; print timelocal("00","00","00","01","01","2000"),"\n";' It will return an epochtime - but only in GMT - if i want the result in GMT+1 (which is the systems localtime(TZ)), what do i need to change? Thanks in advance, Anders ...

Can MySQL convert a stored UTC time to local timezone?

Hi Can MySQL convert a stored UTC time to local timezon:ed time directly in a normal select statement? Let's say you have some data with a timestamp (UTC). CREATE TABLE `SomeDateTable` ( `id` int(11) NOT NULL auto_increment, `value` float NOT NULL default '0', `date` datetime NOT NULL default '0000-00-00 00:00:00', PRIMAR...

How can I display the correct created and modified times in my webapp?

I'm working on a Rails application that's kind of like a blog. Users create Entries. I'm trying to work out how to handle time storage and display. I've read this writeup about Rails timezone support. It's great but it doesn't cover what my app needs to do. It only looks at cases where you want to convert stored time to the current logg...

How do I get GWT DateTimeFormat to display using the server TimeZone, rather than the client's?

I am trying to display a (java.util.)Date client-side, and it keeps using the browser's timezone, resulting in a different date visible depending on where you view the page. How do I get the Formatter (DateTimeFormat) to display the date using the server's timezone rather than the user? Thanks ...

Persisting Joda DateTime instead of Java Date in hibernate

My entities currently contain java Date properties. I'm starting to use Joda Time for date manipulation and calculations quite frequently. This means that I'm constantly having to convert my Dates into Joda DateTime objects and back again. So I was wondering, is there any reason I shouldn't just change my entities to store Joda DateTi...

Java: Convert "Europe/London" to 3 digit timezone

Hi, how can i convert the timezone identifiers to the corresponding 3 digit string? For example "Europe/London" => "GMT" thx ...

JavaScript date constructor and timezone

The Date constructor in JavaScript/ECMAScript/JScript allows passing the number of milliseconds since midnight, 1/1/1970. Nowhere can I find documentation whether this is midnight in the client machine's timezone, or midnight GMT. Which is it? Can it be relied on between different browsers and versions? Is this officially documented a...

Specify a date in another timezone C#

I've got an asp.net application that must run some code every day at a specific time in the Eastern Time Zone (DST aware). So my first thought is, get the eastern time value and convert it to local server time. So I need something like this: var eastern = DateTime.Today.AddHours(17); // run at 5pm eastern var timeZoneInfo = TimeZoneIn...