Here you can find the source of getDateTimeFromSqlTimestamp(Timestamp timestamp)
public static String getDateTimeFromSqlTimestamp(Timestamp timestamp)
//package com.java2s; /*// w ww .j a v a 2s. com * Copyright (c) 2015. Sandata Technologies, LLC * 26 Harbor Park Drive, Port Washington, NY 11050, 800-544-7263 * All rights reserved. * * This software is the confidential and proprietary information of Sandata Technologies, LLC * ("Confidential Information"). You shall not disclose such Confidential Information and shall * use it only in accordance with the terms of the license agreement you entered into with * Sandata. */ import java.sql.Timestamp; public class Main { public static String getDateTimeFromSqlTimestamp(Timestamp timestamp) { if (timestamp != null) { return timestamp.toString().substring(0, 19); } return ""; } }