timezone

fullcalendar confusion with UTC and local date

删除回忆录丶 提交于 2021-01-27 11:40:47
问题 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 $('

NonExistentTimeError when localizing pandas datetime index

我的未来我决定 提交于 2021-01-27 10:03:35
问题 I am using dataframe.index = dataframe.index.tz_localize('Iran') to localize my Pandas dataframe datetime index. The problem is Django rises a NonExistentTimeError . Django setting.py timezone is setted to my local time zone. TIME_ZONE = 'Iran' Dataframe: 2014-08-11 12:00:00+00:00 3076.366 2014-08-11 11:45:00+00:00 3076.367 2014-08-11 11:30:00+00:00 3076.385 2014-08-11 11:15:00+00:00 3076.417 2014-08-11 11:00:00+00:00 3076.466 2014-08-11 10:45:00+00:00 3076.532 2014-08-11 10:30:00+00:00 3076

NonExistentTimeError when localizing pandas datetime index

柔情痞子 提交于 2021-01-27 09:53:47
问题 I am using dataframe.index = dataframe.index.tz_localize('Iran') to localize my Pandas dataframe datetime index. The problem is Django rises a NonExistentTimeError . Django setting.py timezone is setted to my local time zone. TIME_ZONE = 'Iran' Dataframe: 2014-08-11 12:00:00+00:00 3076.366 2014-08-11 11:45:00+00:00 3076.367 2014-08-11 11:30:00+00:00 3076.385 2014-08-11 11:15:00+00:00 3076.417 2014-08-11 11:00:00+00:00 3076.466 2014-08-11 10:45:00+00:00 3076.532 2014-08-11 10:30:00+00:00 3076

NonExistentTimeError when localizing pandas datetime index

南笙酒味 提交于 2021-01-27 09:52:30
问题 I am using dataframe.index = dataframe.index.tz_localize('Iran') to localize my Pandas dataframe datetime index. The problem is Django rises a NonExistentTimeError . Django setting.py timezone is setted to my local time zone. TIME_ZONE = 'Iran' Dataframe: 2014-08-11 12:00:00+00:00 3076.366 2014-08-11 11:45:00+00:00 3076.367 2014-08-11 11:30:00+00:00 3076.385 2014-08-11 11:15:00+00:00 3076.417 2014-08-11 11:00:00+00:00 3076.466 2014-08-11 10:45:00+00:00 3076.532 2014-08-11 10:30:00+00:00 3076

Postgres: “AT TIME ZONE 'localtime'”== “AT TIME ZONE 'utc'”?

自闭症网瘾萝莉.ら 提交于 2021-01-27 06:57:49
问题 I'm struggling to understand how "AT TIME ZONE 'localtime'" exactly work? By playing with it, I found out that it acts exactly as "AT TIME ZONE 'UTC'" ... But why? Is "localtime" a synonym of "UTC" in postgres? Or it comes from some setting (environment? connection timezone? although checked both, seems they are not related)... There's "localtime" function but I think it is not involved here. Sample SQLs: # date Thu Dec 8 12:00:05 AEDT 2016 # SELECT LOCALTIMESTAMP; ---------------------------

node-cron with timezones

杀马特。学长 韩版系。学妹 提交于 2021-01-22 10:35:43
问题 i have a node(v0.7.3-pre) server with node-cron(0.3.2) and node-time(0.8.2): var cronJob = require('cron').CronJob; var cronJ = new cronJob({ cronTime: "00 29 16 6 * *", onTick: function() { console.log("Tick"); }, start:true, timeZone: "America/Los_Angeles" }); console.log(cronJ); it runs, but the Cron is allways working with the server time(UTC), and the returned cron is: { _callbacks: [ [Function] ], onComplete: undefined, cronTime: { source: '00 29 16 6 * *', zone: undefined, second: { '0

node-cron with timezones

末鹿安然 提交于 2021-01-22 10:33:28
问题 i have a node(v0.7.3-pre) server with node-cron(0.3.2) and node-time(0.8.2): var cronJob = require('cron').CronJob; var cronJ = new cronJob({ cronTime: "00 29 16 6 * *", onTick: function() { console.log("Tick"); }, start:true, timeZone: "America/Los_Angeles" }); console.log(cronJ); it runs, but the Cron is allways working with the server time(UTC), and the returned cron is: { _callbacks: [ [Function] ], onComplete: undefined, cronTime: { source: '00 29 16 6 * *', zone: undefined, second: { '0

node-cron with timezones

余生颓废 提交于 2021-01-22 10:33:09
问题 i have a node(v0.7.3-pre) server with node-cron(0.3.2) and node-time(0.8.2): var cronJob = require('cron').CronJob; var cronJ = new cronJob({ cronTime: "00 29 16 6 * *", onTick: function() { console.log("Tick"); }, start:true, timeZone: "America/Los_Angeles" }); console.log(cronJ); it runs, but the Cron is allways working with the server time(UTC), and the returned cron is: { _callbacks: [ [Function] ], onComplete: undefined, cronTime: { source: '00 29 16 6 * *', zone: undefined, second: { '0

Java GregorianCalendar change TimeZone

蹲街弑〆低调 提交于 2021-01-21 04:39:32
问题 I'm trying to set HOUR_OF_DAY field and change Timezone of the GregorianCalendar date object. GregorianCalendar date = new GregorianCalendar(TimeZone.getTimeZone("GMT+10")); System.out.println("HOUR: " + date.get(Calendar.HOUR_OF_DAY)); date.set(Calendar.HOUR_OF_DAY, 23); //date.get(Calendar.HOUR_OF_DAY); date.setTimeZone(TimeZone.getTimeZone("GMT")); System.out.println("HOUR: " + date.get(Calendar.HOUR_OF_DAY)); Output: HOUR: 16 HOUR: 23 For some reason value of HOUR_OF_DAY does not change

Java GregorianCalendar change TimeZone

醉酒当歌 提交于 2021-01-21 04:39:22
问题 I'm trying to set HOUR_OF_DAY field and change Timezone of the GregorianCalendar date object. GregorianCalendar date = new GregorianCalendar(TimeZone.getTimeZone("GMT+10")); System.out.println("HOUR: " + date.get(Calendar.HOUR_OF_DAY)); date.set(Calendar.HOUR_OF_DAY, 23); //date.get(Calendar.HOUR_OF_DAY); date.setTimeZone(TimeZone.getTimeZone("GMT")); System.out.println("HOUR: " + date.get(Calendar.HOUR_OF_DAY)); Output: HOUR: 16 HOUR: 23 For some reason value of HOUR_OF_DAY does not change