org.kde.koala
Class KRFCDate

java.lang.Object
  extended by org.kde.koala.KRFCDate
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KRFCDate
extends java.lang.Object
implements org.kde.qt.QtSupport

The KRFCDate class contains functions related to the parsing of dates.

Author:
Waldo Bastian

Constructor Summary
  KRFCDate()
           
protected KRFCDate(java.lang.Class dummy)
           
 
Method Summary
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
protected  void finalize()
          Deletes the wrapped C++ instance
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
static int localUTCOffset()
          Returns the local timezone offset to UTC in minutes
static int parseDate(java.lang.String date)
          This function tries to parse a string containing a date/time in any of the formats specified by RFC822, RFC850, RFC1036, RFC1123 and RFC2822.
static int parseDateISO8601(java.lang.String date)
          This function tries to parse a string containing a date/time in any of the formats specified by http://www.w3.org/TR/NOTE-datetime This is a subset of the formats specified in ISO8601.
static java.lang.String rfc2822DateString(int utcTime)
          Returns a string representation of the given date and time formated in conformance to RFC2822.
static java.lang.String rfc2822DateString(int utcTime, int utcOffset)
          Returns a string representation of the given date and time formated in conformance to RFC2822.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KRFCDate

protected KRFCDate(java.lang.Class dummy)

KRFCDate

public KRFCDate()
Method Detail

parseDate

public static int parseDate(java.lang.String date)
This function tries to parse a string containing a date/time in any of the formats specified by RFC822, RFC850, RFC1036, RFC1123 and RFC2822. If the date/time could not be parsed, 0 is returned. If the parsed date is epoch, then epoch+1 is returned so that a valid date will not be confused with an improper date string. The date/time returned is converted to UTC.

Parameters:
date - the date to parse
Returns:
the date, or 0 if not possible

parseDateISO8601

public static int parseDateISO8601(java.lang.String date)
This function tries to parse a string containing a date/time in any of the formats specified by http://www.w3.org/TR/NOTE-datetime This is a subset of the formats specified in ISO8601. If the date/time could not be parsed, 0 is returned. If the parsed date is epoch, then epoch+1 is returned so that a valid date will not be confused with an improper date string. The date/time returned is converted to UTC.

Parameters:
date - the date to parse
Returns:
the date, or 0 if not possible

localUTCOffset

public static int localUTCOffset()
Returns the local timezone offset to UTC in minutes

Returns:
the local timezone offset in minutes

rfc2822DateString

public static java.lang.String rfc2822DateString(int utcTime,
                                                 int utcOffset)
Returns a string representation of the given date and time formated in conformance to RFC2822.

Parameters:
utcTime - a date and time in UTC
utcOffset - the offset to UTC in minutes
Returns:
the string representation of the date

rfc2822DateString

public static java.lang.String rfc2822DateString(int utcTime)
Returns a string representation of the given date and time formated in conformance to RFC2822. Provided for convenience, the function is equivalent to rfc2822DateString(t, localUTCOffset()).

Parameters:
utcTime - a date and time in UTC
Returns:
the string representation of the date

finalize

protected void finalize()
                 throws java.lang.InternalError
Deletes the wrapped C++ instance

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.InternalError

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()


isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?