timezone

AllDayEvent timezone Exchange 2003

Hello, I am using WebDav to create an calendar item. I would like to make my item to be an "All day event". However whenever I pass the information to the server, and verify the information in outlook, then the "All day event" checkbox is not checked. For the start and end date I set it to: 2009-05-29T00:00:00.000Z I also set the timezo...

The right ISO 8601 format

I am refactoring some code for a Ruby library. This code includes a Date parser. One of the tests was to parse this string "2008-02-20T8:05:00-010:00" which is supposed to be ISO 8601. The previous code would actually output: "Wed Feb 20 18:05:00 UTC 2008". My new code outputs that: "Wed Feb 20 16:05:00 UTC 2008". My question is: which...

Correctly storing dates with TimeZone in MySQL DB for a Rails application

I'm looking at converting our Rails 2.3 application to correctly handle time zones (at the moment everything is in UTC which isn't right, but is convenient!). I have these settings in environment.rb: config.active_record.default_timezone = :utc config.time_zone = "UTC" Going forward, on each request in our app I plan on making the fo...

Set current Time.zone in Rails?

Javascript on my page saves client UTC offset to the cookie. How do I use this cookie to create a TimeZone and assign it to Time.zone ? I need something like: before_filter :set_time_zone def set_time_zone Time.zone = ActiveSupport::TimeZone.new('my timezone', cookies[:timezone]) end except that the right part of this expression d...

How do I make MySQL's NOW() and CURDATE() functions use UTC?

I want to make it so calls to NOW() and CURDATE() in MySQL queries return the date in UTC. How do I make this happen without going through and changing all queries that use these functions? Believe, me, I have been Googling for the answer, but in 20 minutes, I have found nothing that has worked. ...

TimeZoneInfo to TIME_ZONE_INFORMATION structure

Hey, I've a TimeZoneInfo object and from this one I want to create a TIME_ZONE_INFO struct. Bias, StandardDate and Daylightdate are pretty easy to obtain. However, I'm having problems getting standardbias and daylightbias. So the question is, How can I get the standardbias from a TimeZOneInfo object and how can I get the same thing for ...

Discrepancy between System and Db times

I have a rails application and I store all time in UTC in the database for TimeZone differences' purposes. I also expire a record instead of deleting it by setting "effective_end_date" field in the table to current time. Then I use named scope as follows in the model: named_scope :valid, :conditions => ['(effective_end_date IS NULL OR...

Where can I find a list of timezones in tabular format?

I am looking for a table containing a list of timezones, like this: http://en.wikipedia.org/wiki/ISO_3166-1. I need the timezone code (eg. PST, PDT, EST, GMT, UTC), a name (eg. Pacific Standard Time), and the offset from UTC (eg. -7 for PDT). I've Googled for about ten minutes but have not found this. Does anyone know where can I find t...

How can I easily convert dates from UTC via PHP?

I am storing dates in a MySQL database in datetime fields in UTC. I'm using PHP, and I've called date_timezone_set('UTC') so that all calls to date() (without timestamp) return the date in UTC. I then have it so a given web site can select its timezone. Now I want dates to display in the site's timezone. So, if I have a date stored as '...

How to ensure the right DateTime is used?

I have a Silverlight client that talks to some ASP.NET web services, which then modify a database. The client has data that can be modified and sent via the web services to the database. This data is organised by date. Obviously, the client can reside in a different timezone to the ASP.NET server, so, how do I ensure that the DateTime i...

Handling DST in 24H Application

I'm working on an application that needs to run 24H a day, and am working on correctly implementing support for DST. All times are currently stored in UTC, but I'm having issues when I try to display in local time. Right now I'm using savedDate.ToLocalTime() to convert from DB values to local time for display. This seems to be working...

Calculate user’s time using TimezoneOffset

Hi, I am trying the get the user’s local time to store into my database. I cannot use PHP function now() as it returns the server’s time. I have got the TimezoneOffset by using JavaScript: d = new Date(); alert(d.getTimezoneOffset()/60); How can I calculate the time by using this? And what type should I use for MySQL data type? Than...

How to convert time between timezones (UTC to EDT)?

I need to have a common function to convert UTC time to EDT. I have a server in India. An application in it needs to use EDT time for all time purposes. I am using .NET 3.5. I found this on some other forum. DateTime eastern = TimeZoneInfo.ConvertTimeBySystemTimeZoneId( DateTime.UtcNow, "Eastern Standard Time"); When i tri...

Setting the Time Zone with Compact Framework on Windows Mobile 6

First, background: I have a .Net application that runs in kiosk mode on Windows Mobile 6 devices (IPAQ 210s). Our software actually tracks the user's time zone independently of the operating system, so we calculate the displayed time based on their time zone adjustment from UTC. As many may know, true kiosk mode is not easy to achieve ...

how do I get the string representation of the users timezone using javascript?

I want to output the users system timezone, e.g. "EST". How can I do that, preferably using Javascript, though I could do it on the PHP side as well, if that's significantly easier. ...

Why does MySQL CONVERT_TZ alter the seconds after timezone adjustment?

I'm storing UTC datetime values in MySQL. I use CONVERT_TZ to handle timezone conversion to query/save local datetimes to/from UTC in the database. Upon testing I noticed this strange peculiarity in how the conversion works. Can anyone explain why it is MySQL is adding 23 seconds when using the -4:00 hour offset, but not when using th...

How common are TIMESTAMPS over DATETIME fields?

I want my product, like every other web product out there, to pull a data information from my database and convert it to the user's timezone before displaying it on a page. I am using PHP and MySQL. Is the use of TIMESTAMP fields more common than the use of DATETIME fields? From my research, it seems that using DATETIME fields, I would...

Why not use MySQL's TIMESTAMP across the board?

If you need your web application to translate between timezones on a per-user basis, why not use TIMESTAMP across the board for all date/time fields? Consider that TIMESTAMP values are stored in UTC and converted to the timezone set for the connection when retrieved. I have asked this question on IRC, read the MySQL documentation, searc...

Displaying Time Zone information in Reporting Service Reports (SQL 2005)

Hi, I have a Microsoft SQL 2005, reporting project. I want to display the Current date, time and timezone information on the page header. That is, I want to get a display as below 6/17/2009 12:25:11 PM +05:30 I added a text box to the page header. When set its expression to =Now, used the FormatDateTime function but they all either di...

UTC Problems, not sure how to fix them (PHP/MySQL)

I am seeing UTC date and times in all of my date/time fields on my server, I followed it all back to the timezone setup on my webserver being in UTC time... my question is how can I make these into the local users date and time? All the times are stored in UTC on the MySQL server. I have the users City, Region (Prov/State) and Country....