Here you can find the source of parseSQLiteTimestamp(String dd)
public static Timestamp parseSQLiteTimestamp(String dd)
//package com.java2s; /******************************************************************************* * Copyright (c) 2014 Cai Bowen, Zhou Liangpeng. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * /* w w w .ja v a 2s.c om*/ * Contributors: * Cai Bowen, Zhou Liangpeng. - initial API and implementation ******************************************************************************/ import java.sql.Timestamp; import java.text.SimpleDateFormat; public class Main { public static final SimpleDateFormat SQLITE_DATE_FMT = new SimpleDateFormat("YYYY-MM-DD HH:MM:SS"); public static Timestamp parseSQLiteTimestamp(String dd) { try { return new Timestamp(SQLITE_DATE_FMT.parse(dd).getTime()); } catch (Exception e) { return new Timestamp(System.currentTimeMillis()); } } }