Java Timestamp Convert To toLocalDateTime(Timestamp timestamp)

Here you can find the source of toLocalDateTime(Timestamp timestamp)

Description

to Local Date Time

License

Apache License

Declaration

public static LocalDateTime toLocalDateTime(Timestamp timestamp) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.sql.Timestamp;

import java.time.LocalDateTime;

import java.time.ZoneOffset;

public class Main {
    public static LocalDateTime toLocalDateTime(Timestamp timestamp) {
        if (timestamp == null) {
            return null;
        }/*from w w  w .j av a 2s. co  m*/
        return LocalDateTime.ofInstant(timestamp.toInstant(), ZoneOffset.systemDefault());
    }
}

Related

  1. toEPICSTime(java.sql.Timestamp timestamp)
  2. toFormatedString(final Timestamp ts, final String timeZoneId)
  3. toGmtTimestampString(Timestamp timestamp)
  4. toInstant(final Timestamp timestamp)
  5. toJavaDate(Timestamp dt)
  6. toMediaWikiString(Timestamp timestamp)