Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {

    public static void main(String[] args) {
        LocalDateTime dtPrevistaBR = LocalDateTime.of(2014, 3, 26, 10, 35);

        ZonedDateTime localOrigemZone = ZonedDateTime.of(dtPrevistaBR, ZoneId.systemDefault());

        ZoneId localEntregaZoneId = ZoneId.of("America/Bogota");
        ZonedDateTime dtPrevista = localOrigemZone.withZoneSameInstant(localEntregaZoneId);

        System.out.println("Data Prevista (Brasileira): " + dtPrevistaBR);
        System.out.println("Data Prevista (Bogota): " + dtPrevista.toLocalDateTime());
    }
}