Java SQL Date Create getDateString(String date)

Here you can find the source of getDateString(String date)

Description

get Date String

License

Apache License

Declaration

public static String getDateString(String date) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.Timestamp;

public class Main {

    public static String getDateString(String date) {
        if (date != null && date.length() > 10)
            date = date.substring(0, 10);
        return date;
    }//ww  w .  j  av  a2s .  co m

    public static String getDateString(Timestamp date) {
        if (date == null)
            return null;
        String s = date.toString();
        return s.substring(0, 10);
    }
}

Related

  1. getDateAfter(Date date, Integer after)
  2. getDateAfter(Date date, long offset)
  3. getDateAsString(int month, int date, int year)
  4. getDateFormat()
  5. getDateFormat(java.util.Date date)
  6. getDateString(String pattern)
  7. getDateString2()
  8. getDay(Date date)
  9. getDay(final java.sql.Date date)