return hour,minute,second - Java java.util

Java examples for java.util:Millisecond

Description

return hour,minute,second

Demo Code


//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    /**/*from www.j av  a2 s . c  o m*/
     * 
     * return hour,minute,second
     * 
     * @return
     * */
    public static String[] GetCurentTime() {
        SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
        Date date = new Date(System.currentTimeMillis());
        String string = df.format(date);
        String[] datesss = string.split(":");
        return datesss;
    }
}

Related Tutorials