Answers for "how to get current timestamp in date format java"

0

get current date time timestamp java

// 2021-03-24 16:48:05.591
  Timestamp timestamp = new Timestamp(System.currentTimeMillis());

  // 2021-03-24 16:48:05.591
  Date date = new Date();
  Timestamp timestamp2 = new Timestamp(date.getTime());

  // convert Instant to Timestamp
  Timestamp ts = Timestamp.from(Instant.now())

  // convert ZonedDateTime to Instant to Timestamp
  Timestamp ts = Timestamp.from(ZonedDateTime.now().toInstant()));

  // convert Timestamp to Instant
  Instant instant = ts.toInstant();
Posted by: Guest on May-16-2021
0

java timestamp format

Timestamp(int year, int month, int date, int hour, int minute, int second, int nano)
Posted by: Guest on May-26-2021

Code answers related to "how to get current timestamp in date format java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language