timezone

How do you get info for an arbitrary time zone in Windows?

南楼画角 提交于 2019-12-29 06:47:23
问题 Ideally, what I'd like to be able to do is take the name of a time zone and ask Windows for its corresponding time zone info (offset from UTC, DST offset, dates for DST switch, etc.). It looks like Windows uses a TIME_ZONE_INFORMATION struct to hold this sort of info. So, presumably, I want a function which takes a string with the time zone's name and returns a TIME_ZONE_INFORMATION struct. However, all I can find are functions such as GetTimeZoneInformation() which give me the TIME_ZONE

How to convert UTC date string to local time (systemTimeZone)

瘦欲@ 提交于 2019-12-29 06:45:16
问题 Input String: June 14, 2012 - 01:00:00 UTC Output Local String: Jun 13, 2012 - 21:00:00 EDT I like to get the offset from NSTimeZone* destinationTimeZone = [NSTimeZone systemTimeZone]; NSLog(@"Time Zone: %@", destinationTimeZone.abbreviation); Any suggestion ? 回答1: This should do what you need: NSDateFormatter *fmt = [[NSDateFormatter alloc] init]; fmt.dateFormat = @"LLL d, yyyy - HH:mm:ss zzz"; NSDate *utc = [fmt dateFromString:@"June 14, 2012 - 01:00:00 UTC"]; fmt.timeZone = [NSTimeZone

java Timezone setDefault effects

浪尽此生 提交于 2019-12-29 06:17:04
问题 following How to store date/time and timestamps in UTC time zone with JPA and Hibernate I want to set my application default time zone to UTC. My app runs on tomcat on a linux server along side some other apps. The server has other tomcat instances that run even more apps. Will Timezone.setDefault(tz) affect the other apps on the same tomcat instance? Will it affect other apps on other tomcat instances? Is it possible to set the timezone only for the app? I loosely remember something about

Change timezone of browser [duplicate]

半城伤御伤魂 提交于 2019-12-29 04:41:04
问题 This question already has answers here : How to use a custom time in browser to test for client vs server time difference (7 answers) Closed last year . I need to run browser with a timezone other than operating system's time zone. Is there any way to customize time zone in any browser or is there any plugin available that provides such functionality? 回答1: If you are on Linux, you can launch a process while setting an environment variable for the lifetime of the process. Linux uses the

How to get timezone name (PDT, EST, etc.) in Javascript? [duplicate]

那年仲夏 提交于 2019-12-29 02:00:12
问题 This question already has answers here : Getting the client's timezone offset in JavaScript (26 answers) Get timezone abbreviation using offset value (2 answers) Closed 3 years ago . Using Javascript, is there a way to get a user's timezone name (PDT, EST, etc.) based on the user's device? Code I tried: const timezone = jstz.determine() const userTimezone = timezone.name() But I would like to get back the user's timezone name in PDT, EST, etc. instead of America/New_York. 回答1: Using moment.js

How should I fetch TimeZoneInfo in a platform-agnostic way?

我与影子孤独终老i 提交于 2019-12-29 01:37:09
问题 I'm working on porting a .NET Framework 4.5 app to .NET Core 2.0 and have started to do some testing on my Mac. When I run this code on .NET Core 2.0 on Windows it works fine: TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); but it throws the following exception on the Mac: System.TimeZoneNotFoundException: The time zone ID 'Pacific Standard Time' was not found on the local computer. ---> System.IO.FileNotFoundException: Could not find file '/usr/share/zoneinfo/Pacific Standard

From a timezone and a UTC time, get the difference in seconds vs local time at that point in time

試著忘記壹切 提交于 2019-12-29 01:26:06
问题 This should be very simple, but I can't quite figure it out in Python. I want to have a function which takes two arguments, a UTC time in seconds and a zoneinfo name like 'Europe/Vienna' and returns the offset in seconds from local time and UTC for that point in time. In C it would be: /* ... code to to set local time to the time zone I want to compare against, not shown here. Then call function below to get difference vs localtime. Hardly an ideal solution, but just to demonstrate what I

Formatting timezone of Google Charts datetime axis labels

馋奶兔 提交于 2019-12-28 22:29:32
问题 I'm using GoogleCharts to draw a line chart with a 'datetime' type along one axis. I'd like to format the axis labels so that they display times in a specified timezone instead of the default browser timezone. From reading the documentation, there is a DateFormat object which can be supplied with a 'timeZone' option, and then called with the appropriate DataTable and column to format all cells in that column. I've noticed that doing this results in values that are correctly formatted if the

Is there a way to get a timeZone with (only) a country code (valid ISO-3166 code)?

橙三吉。 提交于 2019-12-28 15:20:52
问题 I'm trying to get a TimeZone for a user. For this I have a country code which is a valid ISO Country Code. These codes are the upper-case, two-letter codes as defined by ISO-3166. You can find a full list of these codes at a number of sites, such as: http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html I think the response is "no because it's a manytomany relationship... there can be many timezone for a country like USA ...". That's the problem... I've tryied something like: //CountryEnum

Oracle date compare broken because of DST

独自空忆成欢 提交于 2019-12-28 06:42:22
问题 We've been debugging an issue with a SQL query executed from an app server running Java via Hibernate. The error: [3/10/14 10:52:07:143 EDT] 0000a984 JDBCException W org.hibernate.util.JDBCExceptionReporter logExceptions SQL Error: 1878, SQLState: 22008 [3/10/14 10:52:07:144 EDT] 0000a984 JDBCException E org.hibernate.util.JDBCExceptionReporter logExceptions ORA-01878: specified field not found in datetime or interval We've been able to narrow this down to the simple SQL below. select * from