Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.ZoneOffset;

public class Main {

    public static void main(String[] args) {
        System.out.println(timeZoneAdjustedDate(LocalDateTime.now()));
    }

    public static Timestamp timeZoneAdjustedDate(LocalDateTime due) {
        return Timestamp.from(due.toInstant(ZoneOffset.ofHours(0)));
    }

}