now Utc as LocalDateTime - Java java.time

Java examples for java.time:LocalDateTime

Description

now Utc as LocalDateTime

Demo Code


//package com.java2s;
import java.time.LocalDateTime;
import java.time.ZoneId;

public class Main {
    public static final ZoneId UTC = ZoneId.of("UTC");

    public static LocalDateTime nowUtc() {
        return LocalDateTime.now(UTC);
    }//  w w  w  .  ja  va2 s .  c  o  m
}

Related Tutorials