Java Hour Format formatWithSql92Date(Date date)

Here you can find the source of formatWithSql92Date(Date date)

Description

format With Sql Date

License

Open Source License

Declaration

public static String formatWithSql92Date(Date date) 

Method Source Code

//package com.java2s;
/**// w  w  w  . jav a2s .  c  om
 * Copyright 2003 ZhongTian, Inc. All rights reserved.
 *
 * qingdao tec PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 * $Id: DBUtil.java,v 1.1 2006/05/17 09:19:30 wiserd Exp $
 * File:DBUtil.java
 * Date Author Changes
 * March 10 2003 wangdeliang Created
 */

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String formatWithSql92Date(Date date) {
        if (date != null) {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh : mm : ss");
            return "{ts '" + sdf.format(date) + "'}";
        } else {
            return "NULL";
        }
    }
}

Related

  1. formatVerbose(int level, String message, String source)
  2. formatW3CDateTime(Date date)
  3. formatW3CDateTime(Date date)
  4. formatWCPDate(String date, String sFormat)
  5. formatWithAge(Date date, String dateFormat, String suffix)
  6. formatXEP0082Date(Date date)
  7. formatXsdDate (final Date date)
  8. formatXsdDateTime(Date d)
  9. getFormattedHoursByMinutes(int minutes)