timezone

How to change log4c's default timezone?

别说谁变了你拦得住时间么 提交于 2020-01-17 01:38:06
问题 I just installed log4c and log4c-devel on CentOS 6.x by yum. All works fine except the log time, it's slow for 8 hours Following is the output of my machine: [rafael@localhost ~]$ date Tue Jan 14 15:17:34 CST 2014 Following is the log produced by log4c: 20140114 07:17:34.453 DEBUG GFXLog- CTimerManager::killTimer: time id-0x0000000198c4e0. you see, slow for 8 hours. I have setup my machine with correct time and timezone, and also keep ntpd running. I think maybe i should setup log4c timezone,

Compare the current EST to 2PM EST? How?

你。 提交于 2020-01-16 20:03:31
问题 So I have this piece of code that would return the current EST Date easternTime = new Date(); DateFormat format = new SimpleDateFormat("h:mm a"); format.setTimeZone(TimeZone.getTimeZone("EST")); return format.format(easternTime); let say it return x = 12:15PM I want to compare x to 3:00PM EST to see if x before or after 3:00PM EST, and/or is x between 3:00PM - 6:00PM EST. Is there a way to do this. We dont have to use java.util.date . I take solution with calendar as well 回答1: I would

Xamarin Form: How do i change from current device time to different country time

。_饼干妹妹 提交于 2020-01-16 09:05:10
问题 I am not too familiar with date time. I am currently wonder how can I convert the existing time of the device to a different countries' date/time. E.g. App.CurrentDate <- which display the device setting date/time. I want it to be in different country's time when choosing different site where the site can be any countries Is it possible to achieve this? 回答1: Android and iOS use IANA timezone names. They look like this “America/New_York” and you can find a list of them at the List of tz

Convert DateTime from UTC to a user provided time zone with C#

倖福魔咒の 提交于 2020-01-16 03:18:04
问题 Say, if I have a database column that holds date/time in UTC time zone, I can read them into DateTime object in my ASP.NET web app written with C#. How do I convert them to a user provided time zone? 回答1: This assumes that time has a Kind = DateTimeKind.Utc You could use ConvertTimeFromUtc: TimeZoneInfo.ConvertTimeFromUtc(time, userTimeZone); Or TimeZoneInfo.ConvertTime: TimeZoneInfo.ConvertTime(time, TimeZoneInfo.Utc, userTimeZone); You will probably want to check out the MSDN article on

Android Timezone.getDefault() gives Asia/Calcutta and not Asia/Kolkata

和自甴很熟 提交于 2020-01-16 01:56:12
问题 I am using the Android TimeZone functionality and my app is communicating with a server that expects Asia/Kolkata from devices in India. However, when getting the TimeZone.getDefault().getDisplayName() , I get Asia/Calcutta and not Kolkata. Knowing that when printing the values in TimeZone.getAvailableIDs() , it shows both, Calcutta and Kolkata. Any ideas? 回答1: Both should be valid. The zone used to be called Asia/Calcutta and was renamed to Asia/Kolkata , but there is still an alias in the

Converting datetime to different timezones with javascript

◇◆丶佛笑我妖孽 提交于 2020-01-15 11:43:08
问题 Im using the InstantAnswer source of the Bing API to retrieve flight status information in JSON format via jQuery.getJSON . This is an example of what im receiving: if(typeof SearchCompleted == 'function') SearchCompleted({"SearchResponse":{"Version":"2.2","Query":{"SearchTerms":"LA1442"},"InstantAnswer":{ "Results":[{"ContentType":"FlightStatus","Title":"flight status for Lan Airlines 1442","ClickThroughUrl":"http:\/\/www.bing.com\/search?mkt=en-US&q=LA1442&form=SOAPGN","Url":"http:\/\/www

Get longer time zone name in PHP

一个人想着一个人 提交于 2020-01-15 06:09:12
问题 Given a time zone abbreviation like "EST", I can get "America/New York" by using timezone_name_from_abbr. Is there any function that returns something like "Eastern Standard Time"? 回答1: In general, you should not trust the timezone_name_from_abbr function, because it only returns the first entry that it finds with a matching abbreviation. Time zone abbreviations are not unique. For example, there are 5 different time zones that share the abbreviation "CST". See this list of abbreviations on

How should I store date/time objects in SQL?

梦想的初衷 提交于 2020-01-15 05:20:07
问题 I've had this question for a long time. The problem is this: most SQL servers I've worked with (namely MySQL) don't store timezone information with dates, so I assume they simply store dates as relative to the server's local timezone. This creates an interesting problem in the case where I'll have to migrate servers to different timezones, or if I create a cluster with servers spread out over different datacenters, or if I need to properly translate date/times into local values. For example,

Setting/Changing an .NET application's TimeZone

回眸只為那壹抹淺笑 提交于 2020-01-14 19:22:28
问题 Is there a way to set a .NET application's TimeZone to a value other than the OS's TimeZone? For instance, I am using my application on an OS with Central Standard Time set, and I would like the app to behave as if it were in Eastern Standard Time, without having to manually convert all DateTimes in my application using a method like TimeZoneInfo.ConvertTimeBySystemTimeZoneId() . 回答1: No, I don't believe there's any way of doing this. It's not like the time zone is set on a per thread basis

Working with timezone in PHP & MySQL

旧城冷巷雨未停 提交于 2020-01-14 17:51:11
问题 How should I go about dealing with timezone. Is it safe to just store the offset for the user? Or should I also have the Area/Location? When I compared the offset values in Wikipedia and PHP, some doesn't match. Which should I trust? Lastly how should I go about with it in PHP. Can I just do a "Time - Server Offset + User Offset"? 回答1: Area and location is important if you care about retaining all the data. The best way (in my opinion) to store dates is to store a UTC timestamp + the location