Java LocalDateTime to toDateUTCFromJST(LocalDateTime dateTime)

Here you can find the source of toDateUTCFromJST(LocalDateTime dateTime)

Description

to Date UTC From JST

License

Open Source License

Declaration

public static Date toDateUTCFromJST(LocalDateTime dateTime) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.time.LocalDateTime;
import java.time.ZoneId;

import java.time.ZonedDateTime;

import java.util.Date;

public class Main {
    public static final ZoneId ZONEID_JST = ZoneId.of("Asia/Tokyo");

    public static Date toDateUTCFromJST(LocalDateTime dateTime) {
        if (dateTime == null) {
            return null;
        }//from   w w w  .  j a  va 2  s. c  o  m
        ZonedDateTime zonedDateTime = dateTime.atZone(ZONEID_JST);
        return Date.from(zonedDateTime.toInstant());
    }
}

Related

  1. luisDate(LocalDateTime date)
  2. millisToLocalDateTime(Long inMillis)
  3. toDate(LocalDateTime dateTime)
  4. toDate(LocalDateTime ldt)
  5. toDateHeader(LocalDateTime dt)
  6. toJava8(org.joda.time.LocalDateTime x)
  7. toJsonDate(LocalDateTime date)
  8. tokenExpired(LocalDateTime expiryDate)
  9. toMinuteCount(LocalDateTime ldt)