Answers for "convert date to timestamp java"

3

java timestamp from string

//parse ISO local date time String
LocalDateTime timestamp=LocalDateTime.parse("2007-12-03T10:15:30");
//parse custom String
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy MM dd HH:mm");
LocalDate parsedDate = LocalDate.parse("1970 01 01 00:00", formatter);
Posted by: Guest on April-14-2021
3

convert timestamp to datetime

from datetime import datetime

timestamp = 1545730073
dt_object = datetime.fromtimestamp(timestamp)

print("dt_object =", dt_object)
print("type(dt_object) =", type(dt_object))
Posted by: Guest on May-19-2020
0

convert timestamp to datetime

from datetime import datetime

# current date and time
now = datetime.now()

timestamp = datetime.timestamp(now)
print("timestamp =", timestamp)
Posted by: Guest on May-19-2020
-1

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.
Posted by: Guest on March-05-2021

Code answers related to "convert date to timestamp java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language