Here you can find the source of getTimeLong()
public static long getTimeLong()
//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; } } }