Android SQL Date Format date2String(java.sql.Date date)

Here you can find the source of date2String(java.sql.Date date)

Description

date String

Declaration

@SuppressWarnings("deprecation")
    public static String date2String(java.sql.Date date) 

Method Source Code

//package com.java2s;

public class Main {
    @SuppressWarnings("deprecation")
    public static String date2String(java.sql.Date date) {
        if (date == null)
            return "";
        return (date.getYear() + 1900) + "-" + (date.getMonth() + 1) + "-"
                + date.getDate();/*from  ww  w .  j  a va 2  s. c o  m*/
    }
}

Related

  1. formatDate(java.util.Date value)
  2. formatDate(java.util.Date value, String defaultFormat)
  3. DateToStringSQL(Date date, String separador)
  4. DateToString(Date date, String separador)
  5. DateToString(Date date)