Java Time Now printTime()

Here you can find the source of printTime()

Description

print Time

License

Apache License

Declaration

public static void printTime() 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static void printTime() {
        System.out.println(getTime());
    }/*w w  w .ja  va2s . c om*/

    public static String getTime() {
        return dateFormat.format(new Date());
    }
}

Related

  1. getTimeString()
  2. getTimeString()
  3. getTimeString()
  4. getTimeString()
  5. printTime()
  6. printTime(Date date)
  7. readCurrentTime()