timezone

How to modify existing tables for timezone addition

妖精的绣舞 提交于 2019-12-12 21:38:21
问题 I have a large application with 500+ tables, I have to convert the application to be timezone aware (currently application uses new java.util.Date() , GETDATE() with server's timezone). i.e. no timezone support whatsoever. I have organised this task into a few steps so as to ease development, my first identified step is to change all old dates to UTC based on the server's timezone. (mostly located in one timezone, so this is my best guess) Next, I need to modify the database and application

PHP IntlDateFormatter wrong date/time conversion

女生的网名这么多〃 提交于 2019-12-12 19:38:47
问题 I recently stumbled on a problem with PHP v7.0.4. when trying to format some dates in the past. I work on a project, in which there is a thing called "empty date", basically a "1800-01-01" (used instead of the NULL value). I'm using GMT+1, "Europe/Berlin". In process of handling it, and with the Date localization involved, the IntlDateFormatter started making some issues and I chased them down to having exceptions if the dates are <= 1893-04-01 (an early April fool thing?). You can see some

How should I store data for events in different timezones?

醉酒当歌 提交于 2019-12-12 19:08:31
问题 This is a conceptual question, so no code snippets here. Say I create a database of events. Some of them are in New York, some in Chicago, some in Phoenix, etc... My server's timezone is set to New York. In my mind, I have two options when creating UNIX timestamps for all these events. Take the timezone into account. (i.e., An event at midnight on January 1 in Chicago and Pheonix would have different timestamps). Then I'd have to take the timezone into account again whenever I want to display

Laravel 5.3 : Setting time zones based on users location

我只是一个虾纸丫 提交于 2019-12-12 18:47:36
问题 We have small blog application in Laravel 5.3 in which i need some suggestion about setting time stamps on the following features 1.Admin can able to send notifications to all users with current time stamp (server timezone is Asia/Calcutta) user will see all the notifications based on their time zones. 2.Users can add posts along with their current time stamps , when other users see that posts based on their time zones. So what are the changes i need to do on the timezone settings in my

psycopg2 to deal with timestamp without time zone

拥有回忆 提交于 2019-12-12 18:36:16
问题 I obtain a record from PostgreSQL, which its type is timestamp without time zone I am using psycopg2 I might get datetime object if I am using timestamp with time zone . But, currently, this is not the case. http://initd.org/psycopg/docs/usage.html#time-zones-handling I realize I am getting float type instead. How can I suppose to get value like from the given float? Jan 07, 2010 16:38:49 connection.cursor.execute(sql, data) records = connection.cursor.fetchall() # In PostgreSQL, type is

How set default timezone in node js for windows

社会主义新天地 提交于 2019-12-12 18:19:17
问题 I'm trying to set the time zone at the start of the application set "TZ=UTC" node main.js But is not work: // main.js var tz = process.env.TZ; var date = new Date(); console.log(tz, '||', date); UTC Tue Nov 17 2015 21:41:29 GMT+0300 回答1: I published a small utility called set-tz which takes advantage of tzutil CLI command. When you call setTZ() it effectively changes your PC's timezone so beware-if you kill the process, you'll need to manually revert back after you're done-I am assuming you'r

C# TimeZone Calculation Problem

旧城冷巷雨未停 提交于 2019-12-12 18:16:53
问题 I have a server application that is processing loans that are in different timezones. The server operates using UTC, a scheduled task will start a process on the server @ 08:00 Local time and select the loans in that time zone for processing. The server must check each loan then for certain loans set a timeout that will fire at a specific Local Time (adjusted for daylight savings), for argument say 17:30 the following day, it will need to calculate the UTC equivalent time then workout the

Mapping IANA/Olson timezone database to abbreviations (like EST, PST, etc)

与世无争的帅哥 提交于 2019-12-12 17:06:08
问题 I need to map IANA/Olson timezone id to abbreviations, like EST, PST, etc. I understand that this is not 1-to-1 mapping and that, for example, for EST there are quite a bunch of IANA timezones. Is there some kind of database/mapping I can use for this? PS: JavaScript solution is preferable, but any info that could help me to build this mapping ( IANA timezone id -> abbreviation ) is appreciated. 回答1: The IANA TZDB source data does have abbreviations already, but they have to be computed for

Converting Between Timezones in Postgres

爷,独闯天下 提交于 2019-12-12 16:33:18
问题 I am trying to understand the timestamps and timezones in Postgre. I think I got it, until I red this article. Focus on the "Converting Between Timezones" part. It has two examples. (Consider the default timezone configuration to be UTC.) Example 1 db=# SELECT timezone('US/Pacific', '2016-01-01 00:00'); outputs 2015-12-31 16:00:00 According to the article and what I understand, because the '2016-01-01 00:00' part of the timezone function is just a string, it is silently converted to the

Properly handle TIME WITH TIME ZONE in PostgreSQL

梦想的初衷 提交于 2019-12-12 16:28:55
问题 We have a table that is filled with data from a legacy report of another system. The columns of that table reflect the same structure of the report. Here are a abbreviated structure of the table: CREATE TABLE IF NOT EXISTS LEGACY_TABLE ( REPORT_DATE DATE NOT NULL, EVENT_ID BIGINT PRIMARY KEY NOT NULL, START_HOUR TIMESTAMP WITHOUT TIME ZONE, END_HOUR TIME WITHOUT TIME ZONE, EXPECTED_HOUR TIME WITHOUT TIME ZONE ); We are refactoring this table to deal with different time zones of different