Android Date to String Convert getCurrentDateStr()

Here you can find the source of getCurrentDateStr()

Description

get Current Date Str

Declaration

public static String getCurrentDateStr() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private static final String ONLY_DATE_FORMAT = "yyyy??MM??dd??";

    public static String getCurrentDateStr() {
        SimpleDateFormat dateFormat = new SimpleDateFormat(ONLY_DATE_FORMAT);
        Date d = new Date(System.currentTimeMillis());
        return dateFormat.format(d);
    }/*from w  w w.  ja v  a  2 s . co m*/
}

Related

  1. dateToIsoDateString(@NotNull Date date)
  2. dateToIsoDateString(@Nullable Date date, @NotNull DateFallback fallback)
  3. formatDate(Date date, String format)
  4. formatDate(String format, Date date)
  5. formatDate(final Date date)
  6. getCurrentDateStrs()
  7. getCurrentTimeStr()
  8. getDateByFormatedString(String date)
  9. getDateTimeString(Date date)