Android Today Get getToday()

Here you can find the source of getToday()

Description

get Today

Declaration

public static long getToday() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    private final static ThreadLocal<SimpleDateFormat> dateFormater2 = new ThreadLocal<SimpleDateFormat>() {
        @Override/*from  w  ww . j  av  a  2 s . co  m*/
        protected SimpleDateFormat initialValue() {
            return new SimpleDateFormat("yyyy-MM-dd");
        }
    };

    public static long getToday() {
        Calendar cal = Calendar.getInstance();
        String curDate = dateFormater2.get().format(cal.getTime());
        curDate = curDate.replace("-", "");
        return Long.parseLong(curDate);
    }
}

Related

  1. getLastyearToday(String str)
  2. getTodayFull()
  3. isToday(Calendar today, Calendar date)
  4. isToday(Calendar date)