Questions tagged [sql-timestamp]
263 questions
3
votes
2 answers
Joda-Time: convert SimpleDateFormat pattern to DateTimeFormat.forPattern
I'm trying to modify some code to use Joda-Time rather than java.sql.Timestamp
Currently the code is using Threadlocal and SimpleDateFormat:
public static final ThreadLocal FORMAT_TIMESTAMP = new ThreadLocal() {
…

JTK
- 1,469
- 2
- 22
- 39
3
votes
1 answer
how to refer timestamp variable in pgsql function having select statement
Hi Am trying to write a pgsql function which performs copy of table data to a csv file and am having difficulty using the variable value inside the function as below:
CREATE OR REPLACE FUNCTION test3() RETURNS void
LANGUAGE plpgsql
AS…

Rajesh Chandrashekar
- 41
- 1
- 1
- 8
3
votes
1 answer
Timestamp conversion in Oracle SQL
I'm using Oracle SQL and i have a dates issue.
I got a long script with many Insert commands such as:
Insert into MyTable
(TIME,CROSS,BID,ASK)
values (to_timestamp('13-NOV-14 03.38.27.785000000 PM','DD-MON-RR HH.MI.SSXFF…

Omri
- 1,436
- 7
- 31
- 61
2
votes
1 answer
Setting timezone = "Asia/Kolkata" in @jsonformat and storing it in java.sql.timestamp converts 12 pm to 1 pm timesatmp to 00 am in spring hibernate
I am using
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy hh:mm:ss", timezone = "Asia/Kolkata")
private Timestamp startDateTime;
to store timestamp comes in json as a string.
But the problem is it converts time between 12 pm to…

James007
- 23
- 3
2
votes
0 answers
PostgreSQL using timestamp difference in partial index for upsert
I need to get real-time data and put it into a Postgres table so compare the columns oid and rcv_time respectively with newly received ones.
If this oid previously has been inserted and its received time is more than two hours from now should be…

fatemeh poormohammad
- 62
- 9
2
votes
2 answers
How to enter timestamp in Vaadin 8
I am trying to enter timestamp using DateTimeField but in my entity i am having java.sql.timestamp. Converting datetimefield to timestamp is giving error
ConversionClass
package com.vaadin.convertor;
import java.sql.Timestamp;
import…

deep Kumar
- 45
- 7
2
votes
1 answer
MySQL String to DATE / TIME or TIMESTAMP
In my data set, the start and end time for a task is given as a string. The string contains:
'Day, Date Month YYYY HH:MM:SS GMT'
'Wed, 18 Oct 2017 10:11:03 GMT'
The previous questions on Stack Overflow do not have data in this format and I have…

Sandy
- 1,100
- 10
- 18
2
votes
3 answers
MySQL - Comparing Two Negative Time Values
I have the following conditional statement in my SQL query:
WHERE TIMEDIFF("03:00:00", VARIABLE) >= "00:05:00"
The above works as expected. If the value returned from TIMEDIFF() is greater than 5 minutes, the record it represents will be returned.…

Lloyd Banks
- 35,740
- 58
- 156
- 248
2
votes
1 answer
Failed to convert parameter value from a Binary to a Byte[]. -- SqlDataSource w/ SQL Timestamp parameter
First, unfortunately I can't change the database and looking for a "strapped for time" solution. I realize what I'm asking for isn't best practice, but enough disclaimers...
MS SQL Server
C# / .NET 4.xx
WebForms
dbo.MyTable -- apps are not allowed…

Ted Krapf
- 403
- 3
- 11
2
votes
3 answers
How to select the SQL data from just 20 days using the TimeStamp
How can i just use the data of the previous 20 days using the TimeStamp. In the below code i am selecting the Timestamp anything above this timstamp i wanted to select and later insert it. But i not interested in all the data which is in database…

user9630935
- 349
- 1
- 4
- 18
2
votes
3 answers
Converting java.sql.Timestamp to Instant Time
From my database i retrieve value as :
20-DEC-17 10.15.53.000000000 AM
I want above java.sql.Timestamp to be converted to Instant time as :
2017-12-20T10:15:53Z
I tried following with current time stamp
Timestamp ts2 = new…

Imran Moosani
- 41
- 1
- 5
2
votes
1 answer
H2 Database - mapping between Java's OffsetDateTime and h2 type
I am using H2 Database for unit tests.
According to the official H2 documentation, there is no mapping between Java's OffsetDateTime and h2 data types (TIMESTAMP WITH TIME ZONE maps to java's H2 TimestampWithTimezone type, which is not what I…

LukeV
- 43
- 1
- 6
2
votes
2 answers
How do I insert Postgres "infinity" into a Timestamp field with JOOQ?
I have a column defined like this:
expiry timestamp(0) without time zone not null
With Postgres, I can issue SQL like:
insert into my_table(expiry) values ('infinity')
I've been digging through the JOOQ doco, but couldn't find any example of…

Shorn
- 19,077
- 15
- 90
- 168
2
votes
1 answer
How can I get Gedmo\Timestampable to keep updated_at null on first create?
I've got a Symfony 2.8 app which uses The Gedmo\Timestampable annotations for automatic created_at and updated_at operations, but it seems to be putting the same timestamp into the updated_at column when the entity/row is first created. An UPDATE…

aalaap
- 4,145
- 5
- 52
- 59
2
votes
2 answers
MySQL union on two tables, one with timestamp and one with date
I am trying to put together a report for the performance of one advert showing the views and clicks that it's had on one day. The views and clicks are stored in separate tables with different structures so I think I have to perform a union.
I have…

FreshSnow
- 394
- 2
- 12