List of utility methods to do Time Get
String | getTimestamp() generate current timestamp return "" + (System.currentTimeMillis() / 1000); |
long | getUTCTime() get UTC Time Calendar cal = Calendar.getInstance(Locale.CHINA); int zoneOffset = cal.get(java.util.Calendar.ZONE_OFFSET); int dstOffset = cal.get(java.util.Calendar.DST_OFFSET); cal.add(java.util.Calendar.MILLISECOND, -(zoneOffset + dstOffset)); return cal.getTimeInMillis(); |
long | getUnixTime() get Unix Time return (new Date()).getTime() / 1000; |
long | getUnixTime() get Unix Time return (long) (System.currentTimeMillis() / 1000); |