timezone

convert GMT time to EST

限于喜欢 提交于 2021-02-08 07:53:06
问题 My sql server is located in GMT and I need to get the EST equivalent tz. Somehow the EST is wrong. select now(),convert_tz(now(),'GMT','EST'),convert_tz(now(),'GMT','EST') - interval 10 minute The EST time should be 20:30 and not 19:30 Here is my results - 回答1: As @ceejayoz mentioned, the timezones of locations change depending on daylight savings observation. In addition, it's more proper to call it UTC rather than GMT, as when you call it GMT, it connotes that your servers are tune to some

Using “tzwhere” module in Python 3

微笑、不失礼 提交于 2021-02-08 06:51:22
问题 I am trying to use the tzwhere module in Python 3. I want to enter in the coordinates of a location and return the timezone. However, when I run the following code: !pip install pytz !pip install tzwhere import pytz from tzwhere import tzwhere tzwhere = tzwhere.tzwhere() timezone_str = tzwhere.tzNameAt(37.3880961, -5.9823299) print(timezone_str) #Europe/Madrid I get this error: FileNotFoundError: [Errno 2] No such file or directory: '/Users/s.rayan/anaconda/lib/python3.6/site-packages/tzwhere

Chrome JavaScript Date Constructor Appears to Get Dates Before 1884 Wrong

寵の児 提交于 2021-02-08 06:15:32
问题 If I pass the unix milliseconds timestamp value for 1/1/1753 (at midnight) (-6847786800000) to the JavaScript Date() constructor in Chrome, the Date Chrome gives me looks really weird. I get other weirdness when I use the Date() constructor that takes seven parameters. Examples are below. Chrome: new Date(-6847786800000): Mon Jan 01 1753 00:03:58 GMT-0456 (Eastern Standard Time) Firefox: new Date(-6847786800000): Mon Jan 01 1753 00:00:00 GMT-0500 (Eastern Standard Time) Note how Chrome made

obtaining the Windows Time Zone index when using TimeZoneInfo.GetSystemTimeZones();

自古美人都是妖i 提交于 2021-02-07 19:15:21
问题 so something I've been struggling with is pulling a list of time zones in .net 4 (C#) to populate a drop down list on a form. I know I can do this: var TimeZoneList = TimeZoneInfo.GetSystemTimeZones(); which will retrieve a list of time zones in a TimeZoneInfo class which has an 'Id' property. The ID is not the Microsoft time zone index though. For example, with eastern time, the 'Id' is simply 'Eastern Standard Time' where as the internal index is '35'. (The rest of the indices are here:

obtaining the Windows Time Zone index when using TimeZoneInfo.GetSystemTimeZones();

老子叫甜甜 提交于 2021-02-07 19:13:46
问题 so something I've been struggling with is pulling a list of time zones in .net 4 (C#) to populate a drop down list on a form. I know I can do this: var TimeZoneList = TimeZoneInfo.GetSystemTimeZones(); which will retrieve a list of time zones in a TimeZoneInfo class which has an 'Id' property. The ID is not the Microsoft time zone index though. For example, with eastern time, the 'Id' is simply 'Eastern Standard Time' where as the internal index is '35'. (The rest of the indices are here:

Datetime timezone deserialization

有些话、适合烂在心里 提交于 2021-02-07 13:41:39
问题 I've developed a Rest API for my app. It sends to the app dates in the following format 2018-09-07T17:29:12+02:00 , where I guess +2:00 represents my timezone as part of one object. In my Flutter app, once I deserialize the received object, it substracts two hours to the actual received DateTime object. The class I'm trying to deserialize is defined as follows: import 'package:json_annotation/json_annotation.dart'; part 'evento.g.dart'; @JsonSerializable(nullable: false) class Evento { final

Datetime timezone deserialization

回眸只為那壹抹淺笑 提交于 2021-02-07 13:41:20
问题 I've developed a Rest API for my app. It sends to the app dates in the following format 2018-09-07T17:29:12+02:00 , where I guess +2:00 represents my timezone as part of one object. In my Flutter app, once I deserialize the received object, it substracts two hours to the actual received DateTime object. The class I'm trying to deserialize is defined as follows: import 'package:json_annotation/json_annotation.dart'; part 'evento.g.dart'; @JsonSerializable(nullable: false) class Evento { final

SimpleDateFormat behaves differently in different timezones JVM

℡╲_俬逩灬. 提交于 2021-02-07 13:25:40
问题 I am following the below code to create a Date object on specified dateTime with a specified Timezone. Note: I haven't set any timezone for jvm; But testing this code with different linux server timezones. String date = "20121225 10:00:00"; String timeZoneId = "Asia/Calcutta"; TimeZone timeZone = TimeZone.getTimeZone(timeZoneId); DateFormat dateFormatLocal = new SimpleDateFormat("yyyyMMdd HH:mm:ss z"); //This date object is given time and given timezone java.util.Date parsedDate =

Launching python within python and timezone issue

泪湿孤枕 提交于 2021-02-07 10:30:36
问题 I had to make a launcher script for my django app, and it seems it somehow switches the timezone to GMT (default being +2), and every datetime is two hours behind when using the script. What could be causing that? Here is the launcher script that I use: #!/usr/bin/env python import os import subprocess import shlex import time cwd = os.getcwd() p1 = subprocess.Popen(shlex.split("python manage.py runserver"), cwd=os.path.join(cwd, "drugsworld")) p2 = subprocess.Popen(shlex.split("python coffee

Javascript convert between timezones with momentjs

只谈情不闲聊 提交于 2021-02-07 08:38:52
问题 in my app the user selects a date + time, and a timezone. This choice must be shown to other users IN THEIR OWN timezone, which means if user A from New York chooses August 8, 3:00 AM in EDT, user B from Beijing will see this datetime converted to China Standard Time (CST). To do this I thought - ok I save user A's date and tell him to select out of 4 timezones. Server side I convert this from his EDT choice to UTC using moment timezone, and save it as UTC in the database, so that when I read