Java Second Format getSecond()

Here you can find the source of getSecond()

Description

get Second

License

Open Source License

Declaration

public static double getSecond() 

Method Source Code


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

import java.text.DecimalFormat;

public class Main {
    private static long timer = 0;
    private static DecimalFormat formatter = new DecimalFormat("#.##");

    public static double getSecond() {
        return format((double) getMili() / 1000.0);
    }//from w ww  . j av a 2  s  .  co m

    private static Double format(double val) {
        return Double.parseDouble(formatter.format(val));
    }

    public static long getMili() {
        return timer / 1000000;
    }
}

Related

  1. getFullDateByMisSecond(long misSecond)
  2. getFutureDate(int seconds)
  3. getIntervalMilSeconds(String startDateStr, String endDateStr, String dateFormat)
  4. getMisSecond(String strDate)
  5. getSecond()
  6. getSecond()
  7. getSecond(Date date)
  8. getSecond(String time)
  9. getSeconds(long time)