Java Long Number to Time getTimeLong()

Here you can find the source of getTimeLong()

Description

get Time Long

License

Apache License

Declaration

public static long getTimeLong() 

Method Source Code


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

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

public class Main {

    public static long getTimeLong() {
        return Long.parseLong(getTimeStr());
    }/* w w w.  j av a 2  s  .c  o m*/

    public static String getTimeStr() {
        SimpleDateFormat dateTimeFormatter = new SimpleDateFormat("yyyyMMddHHmmss");
        try {
            return dateTimeFormatter.format(new Date());
        } catch (Exception e) {
            return null;
        }
    }
}

Related

  1. getTime(long nanos)
  2. getTime(Long time)
  3. getTime(long time, boolean getTimeOnly, boolean fileSystemSafe)
  4. getTimeFromLong(long diff)
  5. getTimeFromLong(long diff)
  6. getTimeOf12(long time)
  7. getTimeOld(long time)
  8. getTimestampDiff(Long old)
  9. getTimeStr(long t)