Answers for "how to get datetime in UTC in java"

1

java get date in utc

OffsetDateTime now = OffsetDateTime.now(ZoneOffset.UTC);
System.out.println(now);
Posted by: Guest on July-08-2020
0

UTC in Java

import java.time.Instant;

Instant timestamp = Instant.now()	// gives the UTC time
Posted by: Guest on September-16-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language