Java Locale Format formatDateToSQLString(Date srcDate)

Here you can find the source of formatDateToSQLString(Date srcDate)

Description

format Date To SQL String

License

Open Source License

Declaration

public static String formatDateToSQLString(Date srcDate) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2005, 2006 IBM Corporation and others. All rights reserved. This program and the
 * accompanying materials are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * //from  ww w.  j  a  v a 2  s .c  o  m
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Locale;

public class Main {
    public static String formatDateToSQLString(Date srcDate) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
        return sdf.format(srcDate);
    }
}

Related

  1. formatDate2Date(Date date, String format)
  2. formatDate2String(Date date, String format)
  3. formatDateByFormat(Date date, String format)
  4. formatDateTime(final Date date)
  5. formatDateTime(java.util.Date date, String format, String locale, String timeZone)
  6. formatDecimal(BigInteger b)
  7. formatDecimalDisplay(final double _numberToFormat, final String _formatToApply)
  8. formatDouble(double in)
  9. formatDouble(double inVal, int inDecs)