timestamp-with-timezone

Oracle conversion of UNIX timestamp to timestamp with time zone

丶灬走出姿态 提交于 2019-12-02 22:09:54
问题 Trying to convert UNIX timestamp to Oracle timestamp with timezone. Expecting to see different output, however datetime part is the same. What is wring ? select (timestamp '1970-01-01 00:00:00' + numtodsinterval(1204104116656/1000,'second')) at time zone tz_offset('EST') from dual; Output: 27-FEB-08 09.21.56 .656000000 AM -05:00 select (timestamp '1970-01-01 00:00:00' + numtodsinterval(1204104116656/1000,'second')) at time zone tz_offset('PST') from dual; Output: 27-FEB-08 09.21.56 .656000000

Unexpected results from SQL query with BETWEEN timestamps

匆匆过客 提交于 2019-12-02 10:45:33
I have created a little test app to track down a problem I experienced with Postgres on Heroku: http://snippi.com/s/xd511rf As you can see in line 49 , I want to retrieve all entries created today . This would be the first two items of my test data with the Ruby Gem DataMapper . When I run this app on my notebook (Ubuntu 12.10, HP, Ruby 1.9.3) everything I get this result, which is right: [ { "id": 1, "text": "Working on some awsomenewss", "category": 0, "starttime": "2013-03-21T15:56:00+01:00", "endtime": "2013-03-21T18:26:00+01:00", "creation": "2013-03-21T16:15:21+01:00" }, { "id": 2, "text

Parsing timestamp with timezone in java?

半世苍凉 提交于 2019-12-01 22:14:46
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.31146+05:30" at java.text.DateFormat.parse(DateFormat.java:357) at com.karthik.Timestampvalidate.main

Change timezone component of TIMESTAMP WITH TIMEZONE in Oracle

♀尐吖头ヾ 提交于 2019-12-01 17:59:59
I have some data that is stored in a TIMESTAMP(6) WITH TIMEZONE column in Oracle, but it is stored in the wrong timezone. By convention, all timestamps in the DB must be stored in UTC, but this data was incorrectly persisted as EDT. The actual values are equivalent to the correct UTC value; the problem is simply that it is stored as 19-JUN-12 12.20.42.000000000 PM AMERICA/NEW_YORK when instead it should be 19-JUN-12 16.20.42.000000000 PM UTC . Is there any way in Oracle to change this? Do you really need to change the data that is stored in the database? Normally, it's sufficient just to

Django Timezone aware DateTimeField default value timezone awareness error

╄→尐↘猪︶ㄣ 提交于 2019-12-01 11:21:38
I am trying to add a DateTimeField to my django model with the maximum timestamp as default value. I already figured out, that the maximum timestamp in Django is 9999/12/31 23:59:59 unlike the maximum timestamp used in my postgres DB. When using this timestamp as default value for the field I get an OverflowError: date value out of range error. Therefore I tried the same with 9999/01/01 00:00:00 like so: start_time = models.DateTimeField(null=False, default=datetime.datetime(9999,01,01,00,00,00,tzinfo=utc)) Now, when I apply this south migration to the database, I get the following exception:

Django Timezone aware DateTimeField default value timezone awareness error

烈酒焚心 提交于 2019-12-01 08:16:03
问题 I am trying to add a DateTimeField to my django model with the maximum timestamp as default value. I already figured out, that the maximum timestamp in Django is 9999/12/31 23:59:59 unlike the maximum timestamp used in my postgres DB. When using this timestamp as default value for the field I get an OverflowError: date value out of range error. Therefore I tried the same with 9999/01/01 00:00:00 like so: start_time = models.DateTimeField(null=False, default=datetime.datetime(9999,01,01,00,00

How to remove timezone from a Timestamp column in a pandas dataframe

大憨熊 提交于 2019-11-30 02:58:59
问题 I read Pandas change timezone for forex DataFrame but I'd like to make the time column of my dataframe timezone naive for interoperability with an sqlite3 database. The data in my pandas dataframe is already converted to UTC data, but I do not want to have to maintain this UTC timezone information in the database. Given a sample of the data derived from other sources, it looks like this: print(type(testdata)) print(testdata) print(testdata.applymap(type)) gives: <class 'pandas.core.frame

How to convert unix timestamp (milliseconds) and timezone in R?

早过忘川 提交于 2019-11-27 07:12:01
问题 I have data which has two columns time and timezone that have the timestamp of events. Examples are: time timezone 1433848856453 10800000 It seems like the timestamp has fractional seconds in the information as well. I don't understand the timezone format but it must be an equivalent unix format. I need to preserve the fractional seconds as well. How do I go from that to something like in R? 2015-01-01 13:34:56.45 UTC Note: This human readable date is not the actual converted values of the

Java Convert GMT/UTC to Local time doesn't work as expected

故事扮演 提交于 2019-11-26 16:08:19
In Order to show a reproducible scenario, I am doing the following Get the current system time (local time) Convert Local time to UTC // Works Fine Till here Reverse the UTC time, back to local time. Followed 3 different approaches (listed below) but all the 3 approaches retains the time in UTC only. { long ts = System.currentTimeMillis(); Date localTime = new Date(ts); String format = "yyyy/MM/dd HH:mm:ss"; SimpleDateFormat sdf = new SimpleDateFormat (format); // Convert Local Time to UTC (Works Fine) sdf.setTimeZone(TimeZone.getTimeZone("UTC")); Date gmtTime = new Date(sdf.format(localTime))

Parse date without timezone javascript

女生的网名这么多〃 提交于 2019-11-26 13:05:48
I want to parse date without timezone in JavaScript. I have tried: new Date(Date.parse("2005-07-08T00:00:00+0000")); Returns Fri Jul 08 2005 02:00:00 GMT+0200 (Central European Daylight Time) new Date(Date.parse("2005-07-08 00:00:00 GMT+0000")); Returns same result new Date(Date.parse("2005-07-08 00:00:00 GMT-0000")); Returns same result I want to parse time: Without time zone. Without calling constructor Date.UTC or new Date(year, month, day). Just simple passing string into Date constructor (without prototype approaches). I have to product Date object, not String . The date is parsed