timezone

How to determine if two IANA time zones are the same in JavaScript?

佐手、 提交于 2019-12-11 08:41:25
问题 Given two different IANA (aka "tz database" or "Olson") time zones, how can I determine if they represent the same zone? For example, Asia/Kolkata and Asia/Calcutta represent the same zone. Another example, Africa/Asmara and Africa/Asmera represent the same zone. These minor spelling differences matter when using APIs that detect or guess the user's time zone, as one cannot then simply compare strings to a previously stored value, because different implementations return different variations

How to set up timezones in a GKE Pod

断了今生、忘了曾经 提交于 2019-12-11 08:29:23
问题 I deployed docker Linux to gcloud gke pod. I added the code bellow, trying to set up the time zone in the dockerfile. This code is running correctly in a local docker. But it does not work in gcloud gke pod. The timezones are in local PST, timezones in GKE Pod are still in UTC. Please help! ENV TZ=America/Los_Angeles RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 回答1: I'm not sure how this is working on your local environment. Looks like you are missing (Ubuntu

Database timezone

孤人 提交于 2019-12-11 08:14:38
问题 I want to set different timezone for different database on a single cpanel(Phpmyadmin).I don't know how to set different timezone for different database. Please help me .. it is possible or not, Thanks in advance... 回答1: If you are using PHP / MYSQL. Place the following code at top of the page or index page. date_default_timezone_set('timezone_name'); example America/New_York Only MySQL (works only for current session) mysql> SET time_zone = 'timezone_name'; For global change mysql> SET

Incorrect time zone displayed in Outlook after updating a calendar event through EWS

主宰稳场 提交于 2019-12-11 07:57:01
问题 I'm having an issue with time zones when updating an appointment. Step 1, create a single event, works fine First I create a single event, running from 10:00 to 11:00 local time (Amsterdam DST, so UTC+2). My Exchange server 2010 (SP2) knows the "W. Europe Standard Time" timezone. No issue there, here's the event in Outlook 2007: This is the XML that creates the event: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://schemas.microsoft.com/exchange

Swift make NSDate from string not working as expected

喜你入骨 提交于 2019-12-11 07:47:24
问题 I'm trying to convert a date string into a NSDate. I have this input date string 2014-10-09 17:57 and this timezone +4 or Asia/Dubai and for some reason, i get this NSDate after i execute the code below 2014-10-09 13:57:00 +0000 . let dateString = "2014-10-09 17:57" let formatter = NSDateFormatter() formatter.dateFormat = "yyyy-MM-dd HH:mm" formatter.timeZone = NSTimeZone(name: "Asia/Dubai") println("\(formatter.dateFromString(dateString))") I want to get a date like this 2014-10-09 17:57

How can I use javascript to get the local time in a rails form?

ぃ、小莉子 提交于 2019-12-11 07:44:52
问题 I'm using the local_time gem to show dates in users local times and it works well for dates already added, to display them in my local time. I'm having a problem adding a new date though and I am trying to pass the users local time (and thus date) in through the HTML form. I figure the client device has their local time and so I need to grab it. Right now I am trying to add a field to my form, as in: = simple_form_for(@link)do |f| ... = f.text_field :local_client_time, value: local_time("#

Joda Time getSecondOfDay on DST switch day

拥有回忆 提交于 2019-12-11 07:34:26
问题 I'm getting strange behavior from Joda Time when trying to get the seconds since midnight on a DST switch day. My code: public static void main(String[] args) { DateTimeZone timeZone = DateTimeZone.getDefault(); System.out.println(timeZone); DateTimeFormatter dateFormatter = DateTimeFormat.shortDate(); DateTimeFormatter dateTimeFormatter = DateTimeFormat.fullDateTime(); LocalDate date = new LocalDate(2016, 10, 29); for (int i=0; i<3; i++) { System.out.println(); System.out.println

Converting Sharepoint TimeZone information to a Java TimeZone

佐手、 提交于 2019-12-11 07:17:40
问题 I'm looking to convert Sharepoint TimeZone information into a Java TimeZone object for use with my application which is using the Sharepoint REST API. I understand that Sharepoint stores all it's timestamps in UTC but, when using the REST API, some of the timestamps are returned time zone adjusted and some are not. The format is the same for both except, as you would expect, the UTC values end with a "Z" and the time zone adjusted values do not. So, it's easy enough to convert those to Java

How to present Rails form datetime select in different time zone?

本小妞迷上赌 提交于 2019-12-11 07:13:37
问题 I would like to present a datetime select to the user in their preferred time zone but store the datetime as UTC. Currently, the default behavior is to display and store the datetime field using UTC. How can I change the behavior of this field without affecting the entire application (i.e. not changing the application default time zone)? Update: This is not a per-user timezone. I don't need to adjust how times are displayed. Only these specific fields deal with a different time zone, so I

How to get the timezone of a location in iOS app? [duplicate]

喜欢而已 提交于 2019-12-11 07:03:10
问题 This question already has answers here : How to get a time zone from a location using latitude and longitude coordinates? (15 answers) Get Timezone/country from iPhone (3 answers) Closed 2 years ago . I am new to iOS development. I am trying to build an app which can primarily do two things: a. get user's system time (say, his phone is in London, so his time) b. get the time in a given location (say, San Francisco) and then, I want to calculate the difference in time between the location (e.g