timezone

TimeZone doesn't match up right

巧了我就是萌 提交于 2021-01-28 09:05:10
问题 I'm using Java's default TimeZone and Calendar classes to try and get the time of different areas, however when I try to use it, it doesn't take into account any +0x:00. For example when I enter "Europe/England" it returns me 1:30, when it's actually 2:30 since right now England is using GMT+1, not GMT. String timeZone = raw.split(" ")[1]; Calendar calendar = new GregorianCalendar(); TimeZone tz; try { tz = TimeZone.getTimeZone(timeZone); calendar.setTimeZone(tz); } catch (Exception e) {

Internet Explorer 11 computed timezone bug

∥☆過路亽.° 提交于 2021-01-28 07:14:54
问题 I am aware of the origin of the problem and googled like half a day, but still couldn't find any good workarounds or solutions for this. Our Angular 7+ application use a timezone interceptor , which looks like this: import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http'; import { Observable } from 'rxjs'; import { Injectable } from '@angular/core'; @Injectable() export class TimezoneInterceptor implements HttpInterceptor { constructor() { } intercept(req:

POSTMAN is returning date fields with changed values

為{幸葍}努か 提交于 2021-01-28 04:21:01
问题 I am consuming a REST service and I am receiving a JSON with date attributes that do not match what is in my database. I have two fields called "initialDate" and "finalDate". In the database they are like this: 07/MAR/19 00:00:00 07/SEP/19 23:59:59 The database timezone: select dbtimezone from dual; +00:00 In my object, inside the Java class, the content of the attributes comes as: public class Klass { @NotNull private Date initialDate; //initialDate.toString() "Thu Mar 07 00:00:00 CLT 2019"

Get the local time from a UTC time

懵懂的女人 提交于 2021-01-27 23:46:12
问题 Let's say I have a data set with the date, latitude, and longitude. dt = data.table(date = c("2017-10-24 05:01:05", "2017-10-24 05:01:57", "2017-10-24 05:02:54"), lat = c(-6.2704925537109375, -6.2704925537109375, -6.2704925537109375), long = c(106.5803680419922, 106.5803680419922, 106.5803680419922)) The time is UTC. Is it possible to transfer that UTC to the local time using the lat and long? 回答1: I found a good answer on converting longitude and latitude to timezones here, so here is how we

Windows Time Zone Dropdown in C# [closed]

自古美人都是妖i 提交于 2021-01-27 23:12:07
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 months ago . Improve this question Is there a simple way to display Windows Time zone drop down in an application in C# so the user can change it? Similar to this Timezone drop down 回答1: I would do this as per the Microsoft Docs. ReadOnlyCollection<TimeZoneInfo> tzCollection; tzCollection =

Does `serverTimezone` param change @@session.time_zone in MySQL?

非 Y 不嫁゛ 提交于 2021-01-27 14:16:17
问题 If I'm making a connection to MySQL with serverTimezone=UTC in my connection URL, will that change the @@session.time_zone variable for my connection to MySQL? Or is the only way to alter @@session.time_zone through issuing a SET time_zone... statement? I was lead to believe that the combination of serverTimezone=UTC and useLegacyDateTimeCode=false would set the @@session.time_zone to UTC (or whatever timezone I passed in as an argument to serverTimezone ) but testing this behaviour with

TimeZoneInfo.ConvertTimeFromUtc returns incorrect result

不羁的心 提交于 2021-01-27 13:57:16
问题 I have a very strange behaviour with TimeZoneInfo.ConvertTimeFromUtc . How do you think what this returns? var date = new DateTime(2000, 1, 1, 12, 0, 0); var dest = TimeZoneInfo.FindSystemTimeZoneById("Belarus Standard Time"); TimeZoneInfo.ConvertTimeFromUtc(date, dest); Belarus Standard Time is UTC+3. And I expect {01.01.2000 15:00:00} . But I see the next: WAT? This worked correctly some days ago. But today I have run unit tests and noticed this. Before running the tests I installed Visual

How to determine if now(utc) is within the range of the given days of the week and times of the day in ISO 8601 format

我是研究僧i 提交于 2021-01-27 13:20:33
问题 I run into this question of how to determine if DateTime.UtcNow (e.g. 2018-01-01T20:00:00Z) falls within the given range of days and times that are in another timezone. There are no specific dates given, just the days of the week, and the time of the day. The given time is in ISO 8601 standard format. To simplify this question, it can be how to check if a UTC time is within business hours in China. For example, the given day and time range is given by someone form China in time zone +08:00,

fullcalendar confusion with UTC and local date

此生再无相见时 提交于 2021-01-27 11:41:44
问题 I do let fullcalendar initialize normally. So it represents current date. (Midnight->midnight, 1day, 1h slots) From some other datasource I get data with timestamps. The format is "YYYY-MM-DD HH:mm" (transmitted as a string, no timezone information) So I convert that string to a moment object and test against fullcalendar.start and .end to see if it is within. moment("2016-04-07 00:00") == $('#calendar').fullCalendar('getView').end This results in false though the following command $('

fullcalendar confusion with UTC and local date

若如初见. 提交于 2021-01-27 11:41:12
问题 I do let fullcalendar initialize normally. So it represents current date. (Midnight->midnight, 1day, 1h slots) From some other datasource I get data with timestamps. The format is "YYYY-MM-DD HH:mm" (transmitted as a string, no timezone information) So I convert that string to a moment object and test against fullcalendar.start and .end to see if it is within. moment("2016-04-07 00:00") == $('#calendar').fullCalendar('getView').end This results in false though the following command $('