Here you can find the source of getZonedDateTimeForComparison(TimeZone zone)
Parameter | Description |
---|---|
zone | the TimeZone |
public static ZonedDateTime getZonedDateTimeForComparison(TimeZone zone)
//package com.java2s; /*//from ww w . jav a 2s.c o m * Copyright (c) Interactive Information R & D (I2RD) LLC. * All Rights Reserved. * * This software is confidential and proprietary information of * I2RD LLC ("Confidential Information"). You shall not disclose * such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered * into with I2RD. */ import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.TimeZone; public class Main { /** * Get a ZonedDateTime for comparison on membership dates * * @param zone the TimeZone * * @return the ZonedDateTime */ public static ZonedDateTime getZonedDateTimeForComparison(TimeZone zone) { ZonedDateTime dt = ZonedDateTime.now(zone.toZoneId()); dt = dt.plus(1L, ChronoUnit.HOURS); dt = dt.truncatedTo(ChronoUnit.HOURS); return dt; } }