Java Time Now getNow()

Here you can find the source of getNow()

Description

get Now

License

Open Source License

Declaration

public static String getNow() 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final String _16DIGIT_DATE_TIME = "yyyy/MM/dd-HH:mm:ss";

    public static String getNow() {
        SimpleDateFormat sdf = new SimpleDateFormat(_16DIGIT_DATE_TIME);

        return sdf.format(new Date());
    }/*  w ww .j a v a2s  .  co  m*/

    public static String format(Date aDate, String type) {
        SimpleDateFormat sdf = new SimpleDateFormat(type);

        return sdf.format(aDate);
    }

    public static String format(Long dateMs, String type) {
        Date date = new Date(dateMs);
        SimpleDateFormat sdf = new SimpleDateFormat(type);
        return sdf.format(date);
    }
}

Related

  1. getDBCurrentTime()
  2. getLogCurrentTime()
  3. getNow()
  4. getNow()
  5. getNow()
  6. getNow()
  7. getNow()
  8. getNow()
  9. getNow()