Here you can find the source of getDBTime(String yyyyMMddHHmmss)
Parameter | Description |
---|---|
tmpTime | 2008042112300 |
public static String getDBTime(String yyyyMMddHHmmss)
//package com.java2s; import java.text.SimpleDateFormat; public class Main { /**//from ww w . j av a 2 s.c o m * @param tmpTime * 2008042112300 * @return "2008-04-21 12:30:00.0" */ public static String getDBTime(String yyyyMMddHHmmss) { String d = ""; try { SimpleDateFormat temp = new SimpleDateFormat("yyyyMMddHHmmss"); d = new java.sql.Timestamp(temp.parse(yyyyMMddHHmmss).getTime()).toString(); } catch (Exception ex) { ex.printStackTrace(); } return d; } }