Java Time Now currentTime()

Here you can find the source of currentTime()

Description

current Time

License

Apache License

Declaration

public static String currentTime() 

Method Source Code

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

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

public class Main {
    public static String currentTime() {
        return reformattedTime(System.currentTimeMillis());
    }/* w w w  .j a  v a  2 s  .  c  om*/

    /**
     * Takes the milliseconds and converts it to the formatted time
     * @param milliSeconds
     * @return the date
     */
    public static String reformattedTime(long milliSeconds) {
        String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(milliSeconds));
        String[] dates = date.split(" ");
        date = dates[0] + "T" + dates[1];
        return date;
    }
}

Related

  1. currentTime()
  2. currentTime()
  3. currentTime()
  4. currentTime()
  5. currentTime()
  6. currentTimedDate()
  7. currentTimeMillis()
  8. currentTimePath(String basePath)
  9. currentTimeStr()