//timezone work needs to happen here
public static void createAppointment(Appointment TemplateAppointment) {
        // look up key to keys and "insert" to make everything work; //To change body of generated methods, choose Tools | Templates.
        String sql = "INSERT INTO appointments Values(NULL, ?, ?,?,?,?,?,Now(),'',Now(),'',?,?,?)";
        // (Appointment_ID,Title,Description, Type, Phone, Division_ID) VALUES (5, '', 'test', '', 'test','')" ;
        try {
            PreparedStatement ps = DBConnection.getConnection().prepareStatement(sql);
            ps.setString(1, TemplateAppointment.getTitle());
            ps.setString(2, TemplateAppointment.getDescription());
            ps.setString(3, TemplateAppointment.getLocation());
            ps.setString(4, TemplateAppointment.getType());
            LocalDateTime start = LocalDateTime.of(TemplateAppointment.getDate(), TemplateAppointment.getStartTime());
            start = WashTimeZone(start, ZoneId.systemDefault(), ZoneId.of("UTC"));
            LocalDateTime end = LocalDateTime.of(TemplateAppointment.getDate(), TemplateAppointment.getEndTime());
            end = WashTimeZone(end, ZoneId.systemDefault(), ZoneId.of("UTC"));
            Timestamp Tstart = Timestamp.valueOf(start);
            Timestamp Tend = Timestamp.valueOf(end);
            ps.setTimestamp(5, Tstart);
            ps.setTimestamp(6, Tend);
//timezone work needs to happen here
            ps.setInt(7, TemplateAppointment.getCustomerid());
            ps.setInt(8, TemplateAppointment.getUserid());
            ps.setInt(9, TemplateAppointment.getContactid());
            ps.execute();
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
    }
ps.setTimestamp(5, Tstart);
ps.setTimestamp(6, Tend);
//timezone work needs to happen here
ps.setInt(7, TemplateAppointment.getCustomerid());
ps.setInt(8, TemplateAppointment.getUserid());
ps.setString(3, TemplateAppointment.getLocation());
ps.setString(4, TemplateAppointment.getType());
LocalDateTime start = LocalDateTime.of(TemplateAppointment.getDate(), TemplateAppointment.getStartTime());
start = WashTimeZone(start, ZoneId.systemDefault(), ZoneId.of("UTC"));
LocalDateTime end = LocalDateTime.of(TemplateAppointment.getDate(), TemplateAppointment.getEndTime());
end = WashTimeZone(end, ZoneId.systemDefault(), ZoneId.of("UTC"));
Timestamp Tstart = Timestamp.valueOf(start);
Timestamp Tend = Timestamp.valueOf(end);
ps.setTimestamp(5, Tstart);
ps.setTimestamp(6, Tend);
//timezone work needs to happen here
ps.setInt(7, TemplateAppointment.getCustomerid());
ps.setInt(8, TemplateAppointment.getUserid());
ps.setInt(9, TemplateAppointment.getContactid());
ps.execute();
} catch (SQLException ex) {
ex.printStackTrace();
}
}
public static void createAppointment(Appointment TemplateAppointment) {
// look up key to keys and "insert" to make everything work; //To change body of generated methods, choose Tools | Templates.
String sql = "INSERT INTO appointments Values(NULL, ?, ?,?,?,?,?,Now(),'',Now(),'',?,?,?)";
// (Appointment_ID,Title,Description, Type, Phone, Division_ID) VALUES (5, '', 'test', '', 'test','')" ;
try {
PreparedStatement ps = DBConnection.getConnection().prepareStatement(sql);
ps.setString(1, TemplateAppointment.getTitle());
ps.setString(2, TemplateAppointment.getDescription());
ps.setString(3, TemplateAppointment.getLocation());
ps.setString(4, TemplateAppointment.getType());
LocalDateTime start = LocalDateTime.of(TemplateAppointment.getDate(), TemplateAppointment.getStartTime());
start = WashTimeZone(start, ZoneId.systemDefault(), ZoneId.of("UTC"));
LocalDateTime end = LocalDateTime.of(TemplateAppointment.getDate(), TemplateAppointment.getEndTime());
end = WashTimeZone(end, ZoneId.systemDefault(), ZoneId.of("UTC"));
Timestamp Tstart = Timestamp.valueOf(start);
Timestamp Tend = Timestamp.valueOf(end);
ps.setTimestamp(5, Tstart);
ps.setTimestamp(6, Tend);
//timezone work needs to happen here
ps.setInt(7, TemplateAppointment.getCustomerid());
ps.setInt(8, TemplateAppointment.getUserid());
ps.setInt(9, TemplateAppointment.getContactid());
ps.execute();
} catch (SQLException ex) {
ex.printStackTrace();
}
}