Java Time Now getTimeString()

Here you can find the source of getTimeString()

Description

Get the current time in the default format.

License

Open Source License

Return

time in formatted string

Declaration

public static String getTimeString() 

Method Source Code

//package com.java2s;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private static final DateFormat timeFormat = new SimpleDateFormat("HHmmss.SSS");

    /**/* w ww.  j  a v a2 s.c  o  m*/
     * Get the current time in the default format.
     *
     * @return time in formatted string
     */
    public static String getTimeString() {
        Date date = new Date();
        return timeFormat.format(date);
    }
}

Related

  1. getSpecifiedDateTime_235959(Date curDate)
  2. getStrCurrentStrTime()
  3. getThaiCurrentTime()
  4. getTimeFromCurrent(long l)
  5. getTimeString()
  6. getTimeString()
  7. getTimeString()
  8. printTime()
  9. printTime()