2
Ich möchte Datum in Timestamp für das Festlegen der Variable konvertieren. Ich habe unten Code aber scheint ungültig.Datum zu Timestamp mit Nanos
Date org_last_upd_ts=xxxxxxx;
SimpleDateFormat sdf=new SimpleDateFormat("SSSSSS");
Timestamp org_lastupdts=new Timestamp(org_last_upd_ts.getTime());
org_lastupdts.setNanos(Integer.valueOf(sdf.parse(o rg_last_upd_ts.toLocaleString()).toString()));
Irgendeine Idee, wie man das macht?
Mögliches Duplikat [konvertiert Datum UTC zeitzustempeln] (http://stackoverflow.com/questions/25105816/convert-date-to-timestamp-utc) – Bobulous
Mögliches Duplikat [String-Date-Konvertierung mit ns] (http://stackoverflow.com/questions/12000673/string-date-conversion-mit-nanoseconds) – piyushj