Java LocalDateTime Calculate getZonedDateTime(LocalDateTime dateTime, TimeZone timeZone)

Here you can find the source of getZonedDateTime(LocalDateTime dateTime, TimeZone timeZone)

Description

get Zoned Date Time

License

Apache License

Declaration

public static ZonedDateTime getZonedDateTime(LocalDateTime dateTime, TimeZone timeZone) 

Method Source Code


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

import java.time.LocalDate;
import java.time.LocalDateTime;

import java.time.ZoneId;
import java.time.ZonedDateTime;

import java.util.TimeZone;

public class Main {
    public static ZonedDateTime getZonedDateTime(LocalDateTime dateTime, TimeZone timeZone) {
        ZoneId zoneId = timeZone.toZoneId();
        return dateTime.atZone(zoneId);
    }//from   w  w  w.  j av a2s. c o  m

    public static ZonedDateTime getZonedDateTime(LocalDate date, TimeZone timeZone) {
        ZoneId zoneId = timeZone.toZoneId();
        return date.atStartOfDay(zoneId);
    }
}

Related

  1. dayDuration(LocalDateTime startDateTime, LocalDateTime endDateTime)
  2. fastDateTimeWriteHours(LocalDateTime localDateTime)
  3. getShiftResult(ImmutableMap timexUnitMap, LocalDateTime reference, boolean future)
  4. getStartWeekOfMonth(@Nonnull final LocalDateTime aDT, @Nonnull final Locale aLocale)
  5. getTimePart(final LocalDateTime dateTime)
  6. isAfter(LocalDateTime endDateTime, LocalDateTime startDateTime)
  7. isAfterNow(LocalDateTime pValidUntil)
  8. isBefore(LocalDateTime dateTime1, LocalDateTime dateTime2)
  9. isOverdue(LocalDateTime dueTime)