timezone

`XmlConvert.ToDateTime(String)` and `XmlConvert.ToString(DateTime)` outputs are inconsistent

让人想犯罪 __ 提交于 2019-12-10 17:53:10
问题 I having issues with XmlConvert and DateTime . When converting some string with XmlConvert.ToDateTime(String) then convert resulted DateTime back to string with XmlConvert.ToString(DateTime) and resulting string is different from the original string , and depending on local TimeZone. The following console application code demonstrating the issue: using System; using System.Xml; namespace DateTimeXmlConvertTest { class Program { static void Main(string[] args) { Console.WriteLine("Original

Windows CE 6.0 time setting in registry

会有一股神秘感。 提交于 2019-12-10 17:48:20
问题 So I have a Motorola MC3100 Mobile Barcode scanning device with Windows CE 6.0. Now I want to get the device to sync its date/time on boot up with our domain controller using some registry files that I have created. I have used these 2 registry files below to get close to what I require. REG 1 [HKEY_LOCAL_MACHINE\Services\TIMESVC] "UserProcGroup"=dword:00000002 "Flags"=dword:00000010 "multicastperiod"=dword:36EE80 "threshold"=dword:5265C00 "recoveryrefresh"=dword:36EE80 "refresh"=dword

how to convert UTC time to some other time zone (“CST”,“IST”)

喜欢而已 提交于 2019-12-10 17:33:59
问题 In my Android application server will return some UTC date in following format( yyyy-MM-dd HH:mm:ss ) 24hours and I need to convert those time into user's TimeZone for example CST , IST . I did the following code but I do know is it correct or not, please assist me to do the time zone conversion in right way. I get UTC date as json string and converting into user's time zone format and showing Android side private static Date utcDate; private static DateFormat expireFormat = new

Getting Olson timezone ID information from browser via javascript [duplicate]

谁说我不能喝 提交于 2019-12-10 17:31:30
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Javascript/PHP and timezones It is possible to get the Olson timezone id from javascript on the client's machine e.g. (America/New York). I know that PHP can do this via the timezone object, something like this. $timezone->getLocation(); Does similar functionality exist for JS? I know that you can grab the timezone offset of the client as followed: var curdate = new Date(); var offset = curdate.getTimeZoneOffset

Formatting a Date/Time in C#

拈花ヽ惹草 提交于 2019-12-10 17:12:46
问题 I have a date/time string that looks like the following: Wed Sep 21 2011 12:35 PM Pacific How do I format a DateTime to look like this? Thank you! 回答1: The bit before the time zone is easy, using a custom date and time format string: string text = date.ToString("ddd MMM dd yyyy hh:mm t"); However, I believe that the .NET date/time formatting will not give you the "Pacific" part. The best it can give you is the time zone offset from UTC. That's fine if you can get the time zone name in some

Rails: Difference between timezones in hours

戏子无情 提交于 2019-12-10 16:47:01
问题 I'd like to be able to say user1 is 4 hours ahead of user2 , calculated based on the time zones the users specify in their account. Using the following code: time1 = Time.zone.now.in_time_zone(user1.time_zone) time2 = Time.zone.now.in_time_zone(user2.time_zone) distance_of_time_in_words time1,time2 ...gives a difference of less than a minute - similarly subtracting the two times gives 0 . Rails obviously still sees these two times as the same. Any idea how I can calculate this difference

How to set time zone for ASP.NET MVC 5 application?

北战南征 提交于 2019-12-10 16:46:38
问题 I have quite large web application, which is developed with ASP.NET MVC 5 and MsSql 2008. On my PC, I have +0700 UTC, but on my shared hosting I have other time zone. This code gives me correct DateTime. DateTime utcTime = DateTime.UtcNow; string zoneID = "N. Central Asia Standard Time"; TimeZoneInfo myZone = TimeZoneInfo.FindSystemTimeZoneById(zoneID); DateTime custDateTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, myZone); Console.WriteLine(custDateTime.ToString()); Unfortunately, I have

How can I change default timezone in Liferay Portal 5.2+

混江龙づ霸主 提交于 2019-12-10 16:39:56
问题 I'm having an issue using Liferay Portal Community 5.2.3 according to timezones and time offsets. In windows, it seems to work correctly (GMT+2 Madrid picked auto), but when I install in Linux server, timezone gets stuck to UTC (GMT). I've no system-ext.properties, so default is UTC, but then... how it works on Windows? In administration->system properties I get UTC for timezone on both installations What am I doing wrong? And another question. If i set timezone to GMT+2 (CEST), what happens

How can I store and display dates in the timezone as they were originally given?

懵懂的女人 提交于 2019-12-10 16:35:45
问题 I have a server that is being fed data from clients in different timezones. The data feed contains people, their date of birth and other dates of events. For our purposes, it would be convenient if we could just store the dates as their given to us. For example, if the client is in California and it tells us the person's date of birth is May 31st, we'd like to store it in the database as May 31st 1999, pacific time. This way, no matter what timezone you're in, you can see that the person was

How to load time zone data into Moment-timezone.js

ぃ、小莉子 提交于 2019-12-10 16:23:02
问题 I'm struggling to get the timezone data loaded for use by moment-timezone.js. Below is my code (For brevity, I only added 2 zones, but really need to add a lot more): <script src='/js/jquery-1.11.0.min.js' type='text/javascript'></script> <script src="/s/js/moment.js" type="text/javascript"></script> <script src="/s/js/moment-timezone.js" type="text/javascript"></script> <script src="/s/js/moment-timezone-with-data-2010-2020.js" type="text/javascript"></script> <script> moment.tz.add([