Javatpoint Logo
Javatpoint Logo

Java Timestamp toLocalDateTime() Method

The toLocalDateTime() method of Timestamp class converts this Timespan object to a LocalDateTime which represents the same date-time value as this Timestamp.

Syntax

Parameters

NA

Returns

The toLocalDateTime () method of Timestamp class returns a LocalDateTime object which represents the same date-time value as this Timestamp.

Example 1

Test it Now

Output:

Timestamp : 2018-09-01 09:01:15.0
LocalDateTime : 2018-09-01T09:01:15

Example 2

Test it Now

Output:

Timestamp : 2018-09-06 11:00:42.26
Current LocalDateTime : 2018-09-06T11:00:42.260
Next TopicJava Timestamp





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA