Java yyyy formatToSqlDate(final Date date)

Here you can find the source of formatToSqlDate(final Date date)

Description

format To Sql Date

License

Mozilla Public License

Declaration

public static String formatToSqlDate(final Date date) 

Method Source Code

//package com.java2s;
/**/*from w  w  w .j  a  v  a2  s .c  o  m*/
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String formatToSqlDate(final Date date) {
        final DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        final String formattedSqlDate = df.format(date);
        return formattedSqlDate;
    }
}

Related

  1. formatString(Date date)
  2. formattedDate(final String format, final Date tweetPollDate)
  3. formatter()
  4. formatTimeSpan(long time)
  5. formatToEapoDate(Date date)
  6. formatToString(String format, long time)
  7. formatYmd(Date d)
  8. formatYMD(Date d)