org.apache.maven.mercury.util
Class TimeUtil
java.lang.Object
org.apache.maven.mercury.util.TimeUtil
public class TimeUtil
- extends java.lang.Object
- Version:
- $Id: TimeUtil.java 720564 2008-11-25 18:58:02Z ogusakov $
- Author:
- Oleg Gusakov
|
Field Summary |
static java.text.DateFormat |
TS_FORMAT
|
static java.util.TimeZone |
TS_TZ
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TS_TZ
public static final java.util.TimeZone TS_TZ
TS_FORMAT
public static final java.text.DateFormat TS_FORMAT
TimeUtil
public TimeUtil()
getUTCTimestamp
public static java.lang.String getUTCTimestamp()
- Returns:
- current UTC timestamp by yyyyMMddHHmmss mask
getUTCTimestampAsLong
public static long getUTCTimestampAsLong()
- Returns:
- current UTC timestamp by yyyyMMddHHmmss mask as a long int
getUTCTimestampAsMillis
public static long getUTCTimestampAsMillis()
- Returns:
- current UTC timestamp by yyyyMMddHHmmss mask as a long int
getUTCTimestamp
public static java.lang.String getUTCTimestamp(java.util.Date date)
- Parameters:
date -
- Returns:
- current date converted to UTC timestamp by yyyyMMddHHmmss mask
toMillis
public static long toMillis(long ts)
throws java.text.ParseException
- convert timestamp to millis
- Parameters:
ts - timestamp to convert. Presumed to be a long of form yyyyMMddHHmmss
- Returns:
- millis, corresponding to the supplied TS
- Throws:
java.text.ParseException - is long does not follow the format
toMillis
public static long toMillis(java.lang.String ts)
throws java.text.ParseException
- convert timestamp to millis
- Parameters:
ts - timestamp to convert. Presumed to be a string of form yyyyMMddHHmmss
- Returns:
- millis, corresponding to the supplied TS
- Throws:
java.text.ParseException - is long does not follow the format
Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.