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

Output:

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

Example 2

Output:

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