0
I made the following form of license
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, wanted to get a date not of the system more yes example a Timezone do not know how to do this someone could help me on this?
I am using MYSQL as a database the date table is in varchar
Please avoid long discussions in the comments; your talk was moved to the chat
– Maniero