Java Date Now getCurrentStringDateYMD()

Here you can find the source of getCurrentStringDateYMD()

Description

get Current String Date YMD

License

Apache License

Declaration

public static final String getCurrentStringDateYMD() 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    public static final String PATTERN_YYYYMMDD = "yyyy-MM-dd";

    public static final String getCurrentStringDateYMD() {
        return getCurrentStringDate(PATTERN_YYYYMMDD);
    }//from   ww w  .j a v a  2  s  . c om

    public static final String getCurrentStringDate(String pattern) {
        Date currentTime = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat(pattern);
        return formatter.format(currentTime);
    }
}

Related

  1. getCurrentQuarter()
  2. getCurrentSecond()
  3. getCurrentString(String pattern)
  4. getCurrentStringDate()
  5. getCurrentStringDate(String pattern)
  6. getCurrentStrTimeMills()
  7. getCurrentTime()
  8. getCurrentTime()
  9. getCurrentTime()