kdecore Library API Documentation

KRFCDate Class Reference

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

#include <krfcdate.h>

List of all members.

Static Public Member Functions

time_t parseDate (const QString &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.

time_t parseDateISO8601 (const QString &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.

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

QCString rfc2822DateString (time_t utcTime, int utcOffset)
 Returns a string representation of the given date and time formated in conformance to RFC2822.

QCString rfc2822DateString (time_t utcTime)
 Returns a string representation of the given date and time formated in conformance to RFC2822.


Detailed Description

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

Author:
Waldo Bastian <bastian@kde.org>

Definition at line 31 of file krfcdate.h.


Member Function Documentation

time_t KRFCDate::parseDate const QString date  )  [static]
 

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

Definition at line 98 of file krfcdate.cpp.

References QString::latin1().

time_t KRFCDate::parseDateISO8601 const QString date  )  [static]
 

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

Definition at line 340 of file krfcdate.cpp.

References QString::at(), QString::find(), QString::findRev(), QString::left(), QString::length(), QString::mid(), QString::remove(), QString::right(), and QStringList::split().

int KRFCDate::localUTCOffset  )  [static]
 

Returns the local timezone offset to UTC in minutes.

Returns:
the local timezone offset in minutes

Definition at line 434 of file krfcdate.cpp.

Referenced by rfc2822DateString().

QCString KRFCDate::rfc2822DateString time_t  utcTime,
int  utcOffset
[static]
 

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

Definition at line 460 of file krfcdate.cpp.

References QCString::sprintf().

Referenced by rfc2822DateString().

QCString KRFCDate::rfc2822DateString time_t  utcTime  )  [static]
 

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

Definition at line 478 of file krfcdate.cpp.

References localUTCOffset(), and rfc2822DateString().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:14:51 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001