sl
Class ISO8601

java.lang.Object
  extended bysl.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.

Version:
$Date: 2003/10/09 13:00:37 $ $Revision: 1.1.1.1 $
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.
private static java.lang.String zeroPaddingNumber(long value, int digits)
           
 
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.

Throws:
java.lang.Exception

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

zeroPaddingNumber

private static java.lang.String zeroPaddingNumber(long value,
                                                  int digits)

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



Copyright © 2000-2003 BT Exact Technologies. All Rights Reserved.