|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectes.upv.dsic.gti_ia.core.ISO8601
public class ISO8601
This class contains a set of static methods that convert to/from the Date
Time format adopted by FIPA. The FIPA format is based on ISO8601, with the
addition of milliseconds. Using the java.text.SimpleDateFormat
notation, it is: yyyyMMdd'T'HHmmssSSS'Z' , where the
'T' serves to separate the Day from the Time, and the
'Z' indicates that the time is in UTC.
The FIPA specs permit either local or UTC time, however, they do express a
preference for UTC time (this is particularly helpful when passing messages
between agents running on machines in different timezones).
toString(false) is called).
| Constructor Summary | |
|---|---|
ISO8601()
Default constructor. |
|
| Method Summary | |
|---|---|
static void |
main(String[] argv)
The main is here only for debugging. |
static Date |
toDate(String dateTimeToken)
This method converts a FIPA DateTime token to a java.util.Date. |
static String |
toRelativeTimeString(long millisec)
this method converts into a string in ISO8601 format representing relative time from the current time |
static String |
toString(Date d)
This method converts a java.util.Date into a FIPA DateTime
token by using the UTC time. |
static String |
toString(Date d,
boolean useUTCtime)
This method converts a java.util.Date into a FIPA DateTime
token. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ISO8601()
| Method Detail |
|---|
public static Date toDate(String dateTimeToken)
throws Exception
java.util.Date. It will accept both local and UTC time
formats.
an - Exception if the String is not a valid dateTime
Exception
public static String toString(Date d,
boolean useUTCtime)
java.util.Date into a FIPA DateTime
token.
Note: the current default behaviour is to generate dates in UTC time. see
ISO8601.useUTCtime for details.
useUTCtime - controls the style used by toString, 'true'
generates tokens using UTC time, 'false' using local time. If
you need to send messages to agents compiled with older
versions of Jade, then set this to false.
public static String toString(Date d)
java.util.Date into a FIPA DateTime
token by using the UTC time.
public static String toRelativeTimeString(long millisec)
millisec - is the number of milliseconds from now
public static void main(String[] argv)
java jade.lang.acl.ISO8601
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||