String
String

Reputation: 3728

How to Convert SQL Server bigint to timestamp using java code

I have got bigint data from database query like below

duebydate:1302017399984

I want to convert the above duebydate to timestamp using java code

Could any one help?

I knew that in SQL Server we can use predefined functions to convert to timestamp

Upvotes: 0

Views: 293

Answers (1)

LittlePanda
LittlePanda

Reputation: 2507

You can try using the SimpleDateFormat class:

String value = "1302017399984"; 
DateFormat format = new SimpleDateFormat("yyyyMMdd");
format.setLenient(false);
Date date = format.parse(value);

Upvotes: 1

Related Questions