Android Today Get getCurDateTimeinString()

Here you can find the source of getCurDateTimeinString()

Description

get Cur Date Timein String

Declaration

public static String getCurDateTimeinString() 

Method Source Code

//package com.java2s;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {
    public static String getCurDateTimeinString() {
        DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");

        // Get the date today using Calendar object.
        Date today = Calendar.getInstance().getTime();
        // Using DateFormat format method we can create a string 
        // representation of a date with the defined format.
        String reportDate = df.format(today);

        return reportDate;
    }/*  w  w w.j av  a2  s  . c om*/
}

Related

  1. today()
  2. today()
  3. isToday(long lTime)
  4. getToday()
  5. getToday00Time()
  6. today()
  7. isToday(String sdate)
  8. getTodaysDate()
  9. isToday(long dateUtc)