Java LocalDateTime to toDate(LocalDateTime dateTime)

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

Description

to Date

License

Apache License

Declaration

static Date toDate(LocalDateTime dateTime) 

Method Source Code

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

import java.time.LocalDateTime;
import java.time.ZoneOffset;

import java.util.Date;

public class Main {
    static Date toDate(LocalDateTime dateTime) {
        return Date.from(dateTime.toInstant(ZoneOffset.UTC));
    }//from  w  w w . j a va  2 s .c  o  m
}

Related

  1. localDateTimeToString(LocalDateTime value)
  2. localDateTimeToTimestamp(LocalDateTime ldt)
  3. longTOLocalDateTime(long minDate)
  4. luisDate(LocalDateTime date)
  5. millisToLocalDateTime(Long inMillis)
  6. toDate(LocalDateTime ldt)
  7. toDateHeader(LocalDateTime dt)
  8. toDateUTCFromJST(LocalDateTime dateTime)
  9. toJava8(org.joda.time.LocalDateTime x)