jade.lang.acl
Class ISO8601

java.lang.Object
  |
  +--jade.lang.acl.ISO8601

public class ISO8601
extends java.lang.Object

This class contains a set of static methods that allow to convert to/from the Date Time format specified by ISO8601 and adopted by FIPA.

Author:
Fabio Bellifemine - CSELT

Constructor Summary
ISO8601()
           
 
Method Summary
static void main(java.lang.String[] argv)
          The main is here only for debugging.
static java.util.Date toDate(java.lang.String dateTimeToken)
          This method converts a String, that represents a Date Time Token in IS8601 format, to a java.util.Date object.
static java.lang.String toRelativeTimeString(long millisec)
          this method converts into a string in ISO8601 format representing relative time from the current time
static java.lang.String toString(java.util.Date d)
          This method converts a java.util.Date into a String in ISO8601 format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ISO8601

public ISO8601()
Method Detail

toDate

public static java.util.Date toDate(java.lang.String dateTimeToken)
                             throws java.lang.Exception
This method converts a String, that represents a Date Time Token in IS8601 format, to a java.util.Date object.

toString

public static java.lang.String toString(java.util.Date d)
This method converts a java.util.Date into a String in ISO8601 format.
Returns:
a String, e.g. "19640625T073000000" to represent the 7:30 of the 25th of June of 1964.

toRelativeTimeString

public static java.lang.String toRelativeTimeString(long millisec)
this method converts into a string in ISO8601 format representing relative time from the current time
Parameters:
millisec - is the number of milliseconds from now
Returns:
a String, e.g. "+00000000T010000000" to represent one hour from now

main

public static void main(java.lang.String[] argv)
The main is here only for debugging. You can test your conversion by executing the following command:

java jade.lang.acl.ISO8601