localdate to timestamp in java
Timestamp timestamp = Timestamp.valueOf(localDate.atStartOfDay());
localdate to timestamp in java
Timestamp timestamp = Timestamp.valueOf(localDate.atStartOfDay());
How to convert timestamp to time in java
//Timestamp to HH:mm:ss format
Long Timestamp = 1633304782;
Date timeD = new Date(Timestamp * 1000);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
String Time = sdf.format(timeD);
//RESULT this code convert 1633304782 to 05:46:33
date to timestamp java
All you need to do is change the string within the java.text.SimpleDateFormat constructor to: "MM-dd-yyyy HH:mm:ss".
Just use the appropriate letters to build the above string to match your input date.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us