timestamp-with-timezone

Averaging a list of TIMESTAMP(6) WITH TIME ZONE times

感情迁移 提交于 2020-01-06 03:31:27
问题 I've got 2 columns in a database of type TIMESTAMP(6) WITH TIME ZONE. I've subtracted one from the other to get the time between the two timestamps. select lastprocesseddate-importeddate from feedqueueitems where eventid = 2213283 order by written desc; How can I get an average of the list of time differences I have? Here are a small sample of time differences: +00 00:00:00.488871 +00 00:00:00.464286 +00 00:00:00.477107 +00 00:00:00.507042 +00 00:00:00.369144 +00 00:00:00.488918 +00 00:00:00

How to format SQL Server DateTimeOffset and move to Oracle using OracleBulkCopy

痴心易碎 提交于 2020-01-04 21:34:54
问题 I'm trying to move SQL Server DateTimeOffset or Oracle using OracleBulkCopy. For DateTimeOffset(1) the target data type is Timestamp(1) With Time Zone. If I do a select of the DateTimeOffset(1) column on SQL Server I receive the following: 2007-05-08 12:35:29.1 +12:15 When I try to move this to Oracle I receive: ORA-01843: not a valid month It makes sense and I believe the month needs to first, but If I run INSERT into MyOracleTable values('2007-05-08 12:35:29.1 +12:15') I can insert just

Parsing timestamp with timezone in java?

那年仲夏 提交于 2019-12-31 01:51:07
问题 I'm trying to parse a string of format timestamp with timezone obtained from a DB. The String is as follows : SimpleDateFormat mdyFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSSSZ"); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy"); Date d1 = mdyFormat.parse("2014-04-01 15:19:49.31146+05:30"); String mdx = sdf.format(d1); System.out.println(mdx); Problem is, I get an error saying : Exception in thread "main" java.text.ParseException: Unparseable date: "2014-04-01 15:19:49

timezone reconciliation with SQL

家住魔仙堡 提交于 2019-12-25 18:41:29
问题 Question 1/3: I have a number of MySQL databases to connect to and want to ensure time consistency across queries. So for example, one of these servers is currently in the CDT timezone. > select CURRENT_TIMESTAMP, @@system_time_zone, @@global.time_zone, @@session.time_zone; +---------------------+--------------------+--------------------+---------------------+ | CURRENT_TIMESTAMP | @@system_time_zone | @@global.time_zone | @@session.time_zone | +---------------------+--------------------+----

R how to convert timestamps into multiple timezones in the same column

瘦欲@ 提交于 2019-12-25 08:15:40
问题 I have a dataframe that contains two character variables: one is a timestamp and the other is a US state. I have been unsuccessfully trying to convert each timestamp to a POSIX object, with time zone assigned according to the corresponding value for state: Eastern Time (EST) for Florida (FL) and Central Time (CST6CDT) for Texas (TX). However, no matter what I try, R will only return either all of the time stamps in a single time zone or else as a string containing the number of seconds since

Losing timezone-awareness when saving hyerarchical pandas DatetimeIndex to hdf5 in Python

最后都变了- 提交于 2019-12-24 12:33:54
问题 I'm on pandas 0.14.1. Assume I need to index data by two timestamps in a hierarchical index using timezones. When saving the resulted DataFrame to hdf5 I seem to lose timezone-awareness: import pandas as pd dti1 = pd.DatetimeIndex(start=pd.Timestamp('20000101'), end=pd.Timestamp('20000102'), freq='D', tz='EST5EDT') dti2 = pd.DatetimeIndex(start=pd.Timestamp('20000102'), end=pd.Timestamp('20000103'), freq='D', tz='EST5EDT') mux = pd.MultiIndex.from_arrays([dti1, dti2]) df = pd.DataFrame(0,

STR_TO_DATE and ISO8601 Atomtime format

落爺英雄遲暮 提交于 2019-12-24 10:51:02
问题 I have a MySQL database, which I cannot alter, where I read date from. The issue is that I have a varchar column that stores a date. The date is stored in the atomtime format eg. 2014-06-01T00:00:00+02:00 . I cannot figure how to specify the format in the STR_TO_DATE function. I tried STR_TO_DATE(Endtime, '%Y-%m-%dT%H:%i:%s+02:00') , but that doesn't work. Do anyone have a solution for this? I am trying to run the following query (which is not working properly): SELECT *, COUNT(*) as antal

How to pass string with ' ' (timestamp) in prepared statement?

心不动则不痛 提交于 2019-12-23 10:29:11
问题 I am trying to execute the following query INSERT INTO hotspot(timestamp) VALUES (timestamp with time zone '2012-10-25 14:00:00 +05:00' at time zone 'EET'); and i want to pass the timestamp as a variable. My timestamp column is type of timestamp with time zone. Do you have any idea how this can be done? When i do... (Java, Postgresql) String stm= "INSERT INTO hotspot(timestamp) VALUES(timestamp with time zone ? at time zone 'EET')"; pst = con.prepareStatement(stm); pst.setString(1, "2012-08

How to pass string with ' ' (timestamp) in prepared statement?

拜拜、爱过 提交于 2019-12-23 10:28:26
问题 I am trying to execute the following query INSERT INTO hotspot(timestamp) VALUES (timestamp with time zone '2012-10-25 14:00:00 +05:00' at time zone 'EET'); and i want to pass the timestamp as a variable. My timestamp column is type of timestamp with time zone. Do you have any idea how this can be done? When i do... (Java, Postgresql) String stm= "INSERT INTO hotspot(timestamp) VALUES(timestamp with time zone ? at time zone 'EET')"; pst = con.prepareStatement(stm); pst.setString(1, "2012-08

Oracle timestamp with local time zone values transparent translation

早过忘川 提交于 2019-12-22 10:54:43
问题 As far as I know, TIMESTAMP WITH LOCAL TIME ZONE values are transparently translated to and from the user's session time zone. But my values read from the database aren't the same as previously inserted. Is there a database or session parameter I can tweak to fix this? Here is my test case: select systimestamp(0) from dual; -- SYSTIMESTAMP 15/03/2017 19:01:13 +03:00 select dbtimezone from dual; -- DBTIMEZONE -07:00 create table test_timestamps ( id number generated by default on null as