utc

Migration from local server to Azure: TIMEZONE UTC. How to solve?

流过昼夜 提交于 2019-11-30 14:12:45
I designed my application considering the fact that, according to the specifications, should run on a server located in Italy and clients will be italian people only. About a month ago, my bos decided to bring it all on Azure. Everything went smoothly. The only thing that give me some problem is the fact that the time server is UTC. The solutions are: A) simple modify a startup script to the server time ( http://netindonesia.net/blogs/wely/archive/2011/06/26/setting-timezone-in-windows-azure.aspx ) B) more laborious Change to make any application to use UTC and show the time properly converted

How to properly work with Timezone?

a 夏天 提交于 2019-11-30 14:06:25
问题 I'm reading a lot about timezone , offset , utc , local time , javascript functions , DST , bacon and I 'm trying to put this all together to build a solid/correct structure for my app. Suppose my app is something like StackOverflow. That is how I'm doing ... The server is in another country, so I set it to UTC 00:00. I'm storing date as DateTimeOffset . I'm not storing TimeZoneID . Date is being sent to the client in this format: 2012-07-19T14:30:00-03:00 . I'm using angular filter to

MySql - SELECT TimeStamp Column in UTC format

左心房为你撑大大i 提交于 2019-11-30 11:52:20
In my Mysql 5.0 DB I have a column to control LastUpdated information. The Column is a TimeStamp one and MySql automatic updates data. I'm trying to select this column in UTC format. The problem is that the server is setup to US datetime. According to MySql documentation, the DB stores the information in UTC but when I want to display information, it converts it to Server's time. Is there any way to do SELECT command avoiding this convertion? Besides changing the default timezone of the server, the timezone can also be adjusted per connection by executing this SQL statement: SET time_zone =

C# DateTime to UTC Time without changing the time

霸气de小男生 提交于 2019-11-30 11:43:08
问题 How would I convert a preexisting datetime to UTC time without changing the actual time. Example: DateTime dateTime = GetSomeDateTime(); // dateTime here is 3pm dateTime.ToUtcDateTime() // datetime should still be 3pm 回答1: 6/1/2011 4:08:40 PM Local 6/1/2011 4:08:40 PM Utc from DateTime dt = DateTime.Now; Console.WriteLine("{0} {1}", dt, dt.Kind); DateTime ut = DateTime.SpecifyKind(dt, DateTimeKind.Utc); Console.WriteLine("{0} {1}", ut, ut.Kind); 回答2: Use the DateTime.SpecifyKind static method

Updating time offset with moment().utcOffset()

给你一囗甜甜゛ 提交于 2019-11-30 11:38:05
I'm facing some issue trying to use moment.js for dealing with time offsets. I collect in an hidden input the local user time offset: <script type="text/javascript"> $(document).ready(function () { $('input#timeoffset').val(moment().utcOffset()); }); </script> The offset gets correctly stored (in my case its value is -240). Later on the server side (which runs in utc time) I try to update some db stored utcDate doing something like: var userDate = moment(utcDate).utcOffset(offset) My issue is the following: if I run my code as above described I get no effects: utcDate: 20151001 012421 +0000

Twitter timezone & created_at (utc time) values to calculate what time zone the user is in

偶尔善良 提交于 2019-11-30 09:43:27
I'm trying to estimate a twitter user's location based on the time_zone or created_at value in a given tweet object. However it seems that all created_at values I've come across are just in a pointless localised time and the time zone they supply isn't in the most helpful format example tweet "created_at":"Thu Jun 02 14:41:24 +0000 2011" "time_zone":null OR "created_at":"Sun Jan 09 05:03:52 +0000 2011" "time_zone":"Mountain Time (US & Canada)" Both of these times aren't in UTC time and the time_zone isn't in any particular standard format with the rest of the world I'm probably coming across

Displaying time and timezone information to the user (what, not how)

余生长醉 提交于 2019-11-30 09:27:53
(This is a question about the UI rather than the technology required to do it) What is the clearest way to display a time for events occurring in different timezones to a user? Does your "average" user understand UTC and timezones? We capture the local time and UTC offset and store it in the database (SQL 2008 DateTimeOffset) for events happening in different timezones. Users are also in a variety of timezones. I'll suggest a couple of answers below so they can be rated but I'd appreciate alternative suggestions. EDIT: I'd like to avoid displaying the time in the user's timezone. Users in

Chrome interprets ISO time without Z as UTC; C# issue

妖精的绣舞 提交于 2019-11-30 08:57:47
问题 Run this jsfiddle: http://jsfiddle.net/E9gq9/7/ on Chrome, FF, and IE and you get: Chrome: Chrome http://images.devs-on.net/Image/vBTz86J0f4o8zlL3-Region.png Firefox: Firefox http://images.devs-on.net/Image/aNPxNPUpltyjVpSX-Region.png IE: IE http://images.devs-on.net/Image/WXLM5Ev1Viq4ecFq-Region.png Safari: Safari http://images.devs-on.net/Image/AEcyUouX04k2yIPo-Region.png ISO 8601 does not appear to say how a string without a trailing Z should be interpreted. Our server (ASP.NET MVC4) is

Cache.Add absolute expiration - UTC based or not?

和自甴很熟 提交于 2019-11-30 07:52:29
The examples for Cache.Add uses DateTime.Now.Add to compute the expiration, i.e. it passes: DateTime.Now.AddSeconds(60) as the value of the absoluteExpiration parameter. I'd have thought that computing it relative to DateTime.UtcNow would be more correct [as there is no ambiguity if Daylight Savings Time starts in the intervening time between now and the expiration point]. Before the introduction of DateTimeKind , I'd have guessed that there's some ugly hacks in the cache management to make it do something appropriate if the time was not a UTC time. In .NET 2.0 and later, I'm guessing that it

Are .Net's DateTime methods capable of recognising a Leap Second?

孤者浪人 提交于 2019-11-30 07:50:20
问题 With a Leap Second on the horizon for June this year it got me wondering whether the .Net framework is leap second aware? The extra second is to be inserted after the last second of June 30th so UTC will officially be: 2012 June 30, 23h 59m 59s 2012 June 30, 23h 59m 60s 2012 July 1, 0h 0m 0s Is the .Net framework capable of handling this? Does it even matter if Windows is not Leap Second aware? Will this affect apps in mono running on O/S's that are Leap Second aware? EDIT: To expand on this