|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.fxcm.fix.UTCTimestamp
public class UTCTimestamp
UTCTimestamp handles UTC timestamp functionality. Time/date combination represented in UTC (Universal Time Coordinated, also known as "GMT")
| Constructor Summary | |
|---|---|
UTCTimestamp()
Constructor via current UTC date. |
|
UTCTimestamp(Date aID)
Constructor via given date object. |
|
UTCTimestamp(String aTime)
Constructor via given date time string of UTC time. |
|
UTCTimestamp(UTCTimestamp aTimestamp)
Constructor via given UTC timestamp (copy constructor). |
|
UTCTimestamp(UTCTimestamp aDate,
UTCTimestamp aTime)
Constructor via given UTC date and time (combine constructor). |
|
| Method Summary | |
|---|---|
UTCTimestamp |
addDuration(long aMsec)
Rolls up or down the timestamp value. |
int |
compareTo(Object aObj)
Compares this object with the specified object for order. |
boolean |
equals(Object aObj)
Indicates whether some other object is "equal to" this one. |
Date |
getLocalDate()
Deprecated. Date object has no dependency on TimeZone. |
static int |
getLocalTimeZone()
Deprecated. use java.util.Calendar aproach. |
long |
getTime()
Obtains the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this object. |
void |
setDate(Date aTime)
Updates timestamp |
void |
setLocalDate(Date aLocalTime)
Deprecated. Date object has no dependency on TimeZone. |
Date |
toDate()
Converts timestamp to date object. |
Date |
toDate(int aTimeZone)
Deprecated. Date object has no dependency on TimeZone. |
Date |
toDateRef()
Deprecated. There is no anymore such thing as internal Data object inside. |
String |
toString()
Converts timestamp to string with UTC time. |
String |
toString(int aTimeZone)
Deprecated. use java.text.SimpleDateFormat approach |
String |
toStringMs()
Temporary: Converts timestamp to string with milliseconds on UTC time. |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UTCTimestamp()
public UTCTimestamp(UTCTimestamp aTimestamp)
aTimestamp -
public UTCTimestamp(UTCTimestamp aDate,
UTCTimestamp aTime)
aDate - UTC dateaTime - UTC timepublic UTCTimestamp(String aTime)
aTime - date in format "yyyyMMdd-HH:mm:ss"public UTCTimestamp(Date aID)
aID - the Date in Local TimeZone| Method Detail |
|---|
public String toString()
toString in class Object"yyyyMMdd-HH:mm:ss" string.public String toStringMs()
"yyyyMMdd-HH:mm:ss.SSS" string.public Date toDate()
Date object.public long getTime()
public UTCTimestamp addDuration(long aMsec)
aMsec - time offset in millisecond to roll.
UTCTimestamp object rolled up or downpublic boolean equals(Object aObj)
equals in class ObjectaObj - Object
true if this object is the same as the obj argument; false otherwise.public int compareTo(Object aObj)
compareTo in interface ComparableaObj - Object
true if this object is the same as the obj argument; false otherwise.public void setDate(Date aTime)
aTime - new timestampt or null to setup current timepublic String toString(int aTimeZone)
String tz = "GMT";
if (aTimeZone > 0) {
tz += "+";
}
tz += "" + aTimeZone + ":00";
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(""yyyyMMdd-HH:mm:ss"");
sdf.setTimeZone(java.util.TimeZone.getTimeZone(tz));
return sdf.format(toDate());
aTimeZone - time offset in hours
"yyyyMMdd-HH:mm:ss" string.public Date toDateRef()
toDate()
public Date toDate(int aTimeZone)
toDate()
aTimeZone - time offset in hours
public static int getLocalTimeZone()
java.util.Calendar cal = java.util.Calendar.getInstance();
return (cal.get(java.util.Calendar.DST_OFFSET) +
cal.get(java.util.Calendar.ZONE_OFFSET))
/(60 * 60 * 1000);
public Date getLocalDate()
toDate()
public void setLocalDate(Date aLocalTime)
setDate()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||