Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - In oracle and sqlserver, how to convert 13-bit long integer time obtained in java, such as1367911599921,into date type?
In oracle and sqlserver, how to convert 13-bit long integer time obtained in java, such as1367911599921,into date type?
The string Shi Jian = "1367911599921";

Long date =Long.parseLong (Shi Jian);

Date de = new date;

simple date format format = new simple date format(" yyyy-DD-mm HH:mm:ss ");

system . out . println(" time:"+format . format(de));

String sql="to_date("+de+",' YYYY-MM-DD hh:MM:ss ')"; //Put sql statements and write them by yourself.