I made the following license form
con.executaSql("select *from vencimento");
con.rs.last();
SimpleDateFormat df = new SimpleDateFormat("ddMMyyyy");
Date hoje = new Date();
String dataAtual = df.format(hoje);
String dataSistema = con.rs.getString("data");
int diaAt, mesAt, anoAt, diaVenc, mesVenc, anoVenc;
diaAt = Integer.parseInt("" + dataAtual.charAt(0) + dataAtual.charAt(1));
mesAt = Integer.parseInt("" + dataAtual.charAt(2) + dataAtual.charAt(3));
anoAt = Integer.parseInt("" + dataAtual.charAt(4) + dataAtual.charAt(5) + dataAtual.charAt(6) + dataAtual.charAt(7));
diaVenc = Integer.parseInt("" + dataSistema.charAt(0) + dataSistema.charAt(1));
mesVenc = Integer.parseInt("" + dataSistema.charAt(2) + dataSistema.charAt(3));
anoVenc = Integer.parseInt("" + dataSistema.charAt(4) + dataSistema.charAt(5) + dataSistema.charAt(6) + dataSistema.charAt(7));
if ((diaAt <= diaVenc) && (mesAt <= mesVenc) && (anoAt == anoVenc)) {
TelaPrincipal tela = new TelaPrincipal(jTextFieldUsername.getText());
tela.setVisible(true);
dispose();
}else{
TelaValidaSis validasis = new TelaValidaSis();
validasis.setVisible(true);
}
When the user or client changes the date of the computer the system still works, I would like to take a date not from the system but rather a timezone example I do not know how to do this could someone help me about this?
I am using MYSQL as the database the date table is in varchar