Java SQL Date Get getDate(String pattern)

Here you can find the source of getDate(String pattern)

Description

get Date

License

Apache License

Declaration

public static String getDate(String pattern) 

Method Source Code


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

import java.sql.Timestamp;

import java.text.SimpleDateFormat;

public class Main {

    public static String getDate(String pattern) {
        SimpleDateFormat sf = new SimpleDateFormat(pattern);
        return sf.format(new Timestamp(System.currentTimeMillis()));
    }//www. j  a v  a 2s.co m
}

Related

  1. getDate(ResultSet rs, String columnName)
  2. getDate(String aDate, int dif)
  3. getDate(String date)
  4. getDate(String date)
  5. getDate(String format)
  6. getDate(String strDate)
  7. getDate(String theDateStr, int days)
  8. getDate(String value)
  9. getDate(String year, String month, String day)