timezone

XMLGregorianCalendar in java, with NO Timezone

微笑、不失礼 提交于 2020-08-27 03:15:11
问题 How do I create an XMLGregorianCalendar without a timezone? No time offset (0) == UTC which outputs a 'Z' in the output. The meaning of my field is implicit local time, where locality is specified elsewhere on the xml record (such as address). How do I create an XMLGregorianCalendar with undefined timezone (TimeZone indeterminate)? Valid XML ISO-8601 Gregorian Calendar formats include: CCYY-MM-DDThh:mm:ss – without Zulu time designator or TimeOffset refers to the local time of the relative

XMLGregorianCalendar in java, with NO Timezone

倖福魔咒の 提交于 2020-08-27 03:14:40
问题 How do I create an XMLGregorianCalendar without a timezone? No time offset (0) == UTC which outputs a 'Z' in the output. The meaning of my field is implicit local time, where locality is specified elsewhere on the xml record (such as address). How do I create an XMLGregorianCalendar with undefined timezone (TimeZone indeterminate)? Valid XML ISO-8601 Gregorian Calendar formats include: CCYY-MM-DDThh:mm:ss – without Zulu time designator or TimeOffset refers to the local time of the relative

Django filter __date with timezone aware

蓝咒 提交于 2020-08-25 17:22:14
问题 Assume I am using Django 2.x and use default settings. i.e, TIME_ZONE = 'UTC' and USE_TZ = True I am recording data in Honolulu, Hawaii, which means 2019-4-9 9pm (user time) in Honolulu is 2019-4-10 in UTC (server time) Now I want to filter by 2019-4-9 Honolulu time (user time) Here is what a demo code class TimelineTable(models.Model): accessed = models.DateTimeField(auto_now_add=True) def __str__(self): return f'{self.accessed}' Here is the data in TimelineTable (recorded in 2019-4-9

Django filter __date with timezone aware

限于喜欢 提交于 2020-08-25 17:22:05
问题 Assume I am using Django 2.x and use default settings. i.e, TIME_ZONE = 'UTC' and USE_TZ = True I am recording data in Honolulu, Hawaii, which means 2019-4-9 9pm (user time) in Honolulu is 2019-4-10 in UTC (server time) Now I want to filter by 2019-4-9 Honolulu time (user time) Here is what a demo code class TimelineTable(models.Model): accessed = models.DateTimeField(auto_now_add=True) def __str__(self): return f'{self.accessed}' Here is the data in TimelineTable (recorded in 2019-4-9

Django filter __date with timezone aware

给你一囗甜甜゛ 提交于 2020-08-25 17:20:38
问题 Assume I am using Django 2.x and use default settings. i.e, TIME_ZONE = 'UTC' and USE_TZ = True I am recording data in Honolulu, Hawaii, which means 2019-4-9 9pm (user time) in Honolulu is 2019-4-10 in UTC (server time) Now I want to filter by 2019-4-9 Honolulu time (user time) Here is what a demo code class TimelineTable(models.Model): accessed = models.DateTimeField(auto_now_add=True) def __str__(self): return f'{self.accessed}' Here is the data in TimelineTable (recorded in 2019-4-9

In python, how do I create a timezone aware datetime from a date and time?

╄→尐↘猪︶ㄣ 提交于 2020-08-22 04:43:23
问题 In Python, let's say I have a date of 25 December 2016. How can I create a timezone-aware datetime of noon on that date? Bonus points if it's compatible with Django's timezone handling. 回答1: The trick is to first combine the naive time and the date into a naive datetime. This naive datetime can then be converted to an aware datetime. The conversion can be done using the third party package pytz (using, in this case, the 'Europe/London' timezone): import datetime import pytz naive_time =

Is EST5EDT equal to ET?

天大地大妈咪最大 提交于 2020-08-11 03:55:09
问题 I know that ET (Eastern Time) has the DST from EST and EDT, but im looking for that timezone in different libraries of different programming languages and ET is not an option, but EST5EDT is. Thanks. 回答1: Short answer : No, They are not equal because EST5EDT doesn't have any history of changes that US Eastern Time has been through. Use America/New_York instead, which does. Longer answer: EST5EDT is a POSIX time zone definition which can be used in a TZ environment variable on many systems.

Python - pandas datetime column with multiple timezones

爱⌒轻易说出口 提交于 2020-07-30 09:27:47
问题 I have a data frame with multiple users and timezones, like such: cols = ['user', 'zone_name', 'utc_datetime'] data = [ [1, 'Europe/Amsterdam', pd.to_datetime('2019-11-13 11:14:15')], [2, 'Europe/London', pd.to_datetime('2019-11-13 11:14:15')], ] df = pd.DataFrame(data, columns=cols) Based on this other post, I apply the following change to get the user local datetime: df['local_datetime'] = df.groupby('zone_name')[ 'utc_datetime' ].transform(lambda x: x.dt.tz_localize(x.name)) Which outputs

Detect timezone abbreviation using luxon

匆匆过客 提交于 2020-07-30 08:08:09
问题 Moment timezone results with short timezone abbreviations, e.g moment.tz([2012, 0], 'America/New_York').format('z'); // EST moment.tz([2012, 5], 'America/New_York').format('z'); // EDT Is there a similar way we can achieve that using luxon I tried offsetNameShort , but, it results to GMT+5:30 for a date like "2020-05-23T13:30:00+05:30" Something like DateTime.fromISO(""2020-05-23T13:30:00+05:30"").toFormat('z') doesn't work either Is there a way we can remove the +5:30 timezone from the

Laravel + Carbon + Timezone

天涯浪子 提交于 2020-07-21 05:24:45
问题 I have configured the timezone in config/app.php to Europe/Lisbon . If I do a return date_default_timezone_get(); , It returns Europe/Lisbon like I want. So far so good! When I do Carbon::now() it returns for example 16 hour while the current time is 17h. Can someone explain why the daylight saving aren't considered? I'm using Laravel 7.16, PHP 7.4 Regards EDIT 1: Code image + Times | https://imgur.com/pfh6uij EDIT 2: always done php artisan optimize:clear to clear all caches when I change