This function generally used to get timestamp
from miliseconds, date, timeuuid or other timely objects.
Questions tagged [to-timestamp]
35 questions
0
votes
1 answer
Date changes to next day Impala
I have a ‘Response_Date ‘ column that has VARCHAR datatype. This shows eastern time. The date is 3/31/2023 22:30. I am needing to change the format to date 3/31/2023 12:00:00 AM. When I use to_timestamp(Response_Date,’yyyy-MM-dd) as RES_DT, the date…
0
votes
1 answer
Spark Scala to_timestamp() function throwing DateTimeParseException (Fail to parse) error instead of returning null
According to the documentation to_timestamp function ideally should return null instead of throwing a Fail to parse error:
The following code throws Caused by: java.time.format.DateTimeParseException: Text '17-08-01' could not be parsed at index…

PDerp15
- 80
- 4
0
votes
1 answer
Number of records in a period of time PostgreSQL
I have a PostgreSql query, which should make a count of the results that exist between that time frame (between the field "date" and the current time "now"), however the query does nothing but count all the records without applying the filter, does…

leonardo189
- 13
- 6
0
votes
0 answers
Converting SQL query into PostgreSQL
I am trying to convert this SQL Server query below into PostgreSQL...
SQL Server Query:
DECLARE @UTC_OFFSET integer
set @UTC_OFFSET = -4 --EDT -- -5 for EST
select
DATEADD(hour,@UTC_OFFSET, CAST((q.FIRED_TIME - 599266080000000000) / 10000000 /…
0
votes
1 answer
Remove milliseconds from timestamp pyspark SQL
I have two fields, both in string type. One field is called date, the other time.
The date field has values like below:
20220328,20220329,20220330,20220331
The timefield has values like below:
043313,045546,043313,044147
What I need is for these…

rutgerv
- 43
- 10
0
votes
1 answer
postgresql invalid input syntax for type double precision
I have a table with the birth and death of several europe monarchs, the table doesn't have have an age column and i have to add it. There are also several null and 'None' values, in that case the age column should display unknow.
the following code…

Jose Armas
- 23
- 1
- 9
0
votes
1 answer
Postgres; select integers representing date and time query using to_timestamp between '2021-12-01 00:00:00' and '2021-12-01 23:59:59'
I have columns that contain unix timestamps - integers representing the number of seconds since the epoch. They look like this: 1638888715. I am comfortably converting this int into a timestamp using the to_timestamp() function and arriving at…

chuckrocks
- 33
- 5
0
votes
3 answers
Oracle String to Date to Timestamp
I have a date that is saved as 1900-01-01T00:00:00.000Z string Format. I am trying to convert it, but 1900 is changed to 2000. How to convert into timestamp without losing the year?
SELECT…

jolly
- 75
- 10
0
votes
1 answer
Postgres to_timestamp setting timezone to +1
I am using the to_timestamp function in Postgres to convert an integer value to a timestamp. When I do this, the timezone is set to +1, adding an hour to the stored time.
I am located in the UK so the current timezone offset should be +0, not…

user14131782
- 736
- 1
- 11
- 20
0
votes
1 answer
Snowflake Timestamp column not loaded using Copy Command
I am using Copy command to load a file in table. It has a timestamp column.
In my File format I have defined Timestamp as other and gave value as MM/DD/YYYY HH:MI:SS AM
to match with data.
When I execute it loads all records which have timestamp…

PythonDeveloper
- 289
- 1
- 4
- 24
0
votes
1 answer
Oracle Date formatting 9999-06-15T00:00:00.000+0000 in 12c
I have got a date coming from the webservice in 9999-06-15T00:00:00.000+0000 format.
How do i save this into the date column of a table in Oracle 12c DB.
I have tried
select to_date('9999-06-15T00:00:00.000+0000', 'YYYY-MM-DDTHH24:MI:SS.fff+0000')
…

TheDS
- 101
- 2
- 11
0
votes
1 answer
String to Timestamp Pyspark / Spark
I have requirement to convert a input string 08-DEC-2011 00.00.00 to timestamp 20111208000000 - The data in the file.
"CLIENTCONTEXTID","SRVR","CLNT","USERNAME","UPDATEDTM"
1202,"jbosswabcd6","100.126.164.172","SUSER",08-DEC-2011…

Rafa
- 487
- 7
- 22
0
votes
2 answers
Timestamp validation in pyspark
We are building a data ingestion framework in pyspark and trying to handle timestamp exception.
Basically, want to have a reject record in separate column that does not confirm to the schema.
df = spark.createDataFrame(
[
("1988-06-15…

SwapnilM
- 155
- 2
- 6
- 16
0
votes
3 answers
null values not processed by to_timestamp in oracle sql
I'm trying to load data from a csv with sql-loader. There's one column with date in this format:
2011-12-31 00:00:00.000
I tried it using to_date() but it couldn't handle fractions of second. Therefore I used…

havaey
- 9
- 1
- 5
0
votes
1 answer
How to calculate the arithmetic mean of time oracle?
I have a table in Oracle with the time value in the column, but the column type is nvarchar2, the time format is 0:21:31, how can I calculate the average value i.e. (0: 22: 00 + 0: 24: 00) = 0 : 23: 00

DromiX
- 523
- 1
- 4
- 15