Java Time Now getNowAsString()

Here you can find the source of getNowAsString()

Description

get Now As String

License

Open Source License

Declaration

public static String getNowAsString() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Calendar;

import java.util.TimeZone;

public class Main {
    public static String getNowAsString() {

        Calendar cal = Calendar.getInstance();
        SimpleDateFormat ISO8601Local = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
        TimeZone timeZone = TimeZone.getDefault();
        ISO8601Local.setTimeZone(timeZone);
        return ISO8601Local.format(cal.getTime());
    }//  w  ww  . java  2 s. co m
}

Related

  1. getNow()
  2. getNow(boolean ifdatetime)
  3. getNow(final String format)
  4. getNow(String format)
  5. getNowAsNICSDate()
  6. getNowDateTime()
  7. getNowDateTime()
  8. getNowDateTime()
  9. getNowDateTime()