Here you can find the source of toUtcLocalDateTime(ZonedDateTime zonedDateTime)
public static LocalDateTime toUtcLocalDateTime(ZonedDateTime zonedDateTime)
//package com.java2s; /******************************************************************************* * Copyright (c) 2017 Stichting Yona Foundation This Source Code Form is subject to the terms of the Mozilla Public License, v. * 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. *******************************************************************************/ import java.time.LocalDateTime; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.util.Date; public class Main { public static LocalDateTime toUtcLocalDateTime(ZonedDateTime zonedDateTime) { return zonedDateTime.withZoneSameInstant(ZoneOffset.UTC).toLocalDateTime(); }/*from ww w.ja va2 s.c o m*/ public static LocalDateTime toUtcLocalDateTime(Date date) { return LocalDateTime.ofInstant(date.toInstant(), ZoneOffset.UTC); } }