smjg.libs.util.datetime.DateTime Struct Reference

The smjg.libs.util.datetime.DateTime structure represents a combination of date and time. More...

List of all members.

Public Member Functions

string format (cstring formatString)
 Formats this date and time according to a format string.
Properties
real unixTime ()
real unixTime (real ut)
DateValue date ()
 The date component in local time.
DateValue date (DateValue d)
 The date component in local time.
TimeValue time ()
 The time component.
TimeValue time (TimeValue t)
 Sets the time component, adjusting the date if necessary to remain in the local time day.
int year ()
MONTH month ()
int day ()
DAY_OF_WEEK dayOfWeek ()
int hour ()
int minute ()
int second ()
int millisecond ()
string toString ()
Operators
int opCmp (DateTime dt)
 Compares this date and time with another.
DateTime opAdd (DateInterval di)
 Adds the given date interval to the date component.
DateTime opAdd (TimeInterval ti)
 Adds the given time interval to this date and time.
DateTime opAdd (DateTimeInterval dti)
 Adds the given date and time interval to this date and time.
DateTime opSub (DateInterval di)
 Subtracts the given date interval from the date component.
DateTime opSub (TimeInterval ti)
 Subtracts the given time interval from this date and time.
DateTime opSub (DateTimeInterval dti)
 Subtracts the given date and time interval from this date and time.
DateTimeInterval opSub (DateTime dt)
 Determines the time interval between this and another DateTime.
DateTime opAddAssign (DateInterval di)
 Adds the given date interval to the date component.
DateTime opAddAssign (TimeInterval ti)
 Adds the given time interval to this date and time.
DateTime opAddAssign (DateTimeInterval dti)
 Adds the given date and time interval to this date and time.
DateTime opSubAssign (DateInterval di)
 Subtracts the given date interval from the date component.
DateTime opSubAssign (TimeInterval ti)
 Subtracts the given time interval from this date and time.
DateTime opSubAssign (DateTimeInterval dti)
 Subtracts the given date and time interval from this date and time.

Static Public Member Functions

static DateTime now ()
 Retrieves the current system date and time.
Pseudo-constructors
static DateTime opCall (DateValue d, TimeValue t)
 Constructs a DateTime from the given date and time.
static DateTime opCall (int year, int month, int day, int hour, int minute, int second=0, int ms=0)
 Constructs a DateTime representing the given local date and time combination.
static DateTime opCall (int year, int month, int day, int hour, int minute, float second)
 Constructs a DateTime representing the given local date and time combination.

Public Attributes

DateValue utcDate
 The date component in UTC.
TimeValue utcTime
 The time component.


Detailed Description

The smjg.libs.util.datetime.DateTime structure represents a combination of date and time.

Bug:
Checking for invalid/null components not fully implemented.

Member Function Documentation

static DateTime smjg.libs.util.datetime.DateTime.opCall ( DateValue  d,
TimeValue  t 
) [static]

Constructs a DateTime from the given date and time.

Parameters:
d the date component in local time.
t the time component.

static DateTime smjg.libs.util.datetime.DateTime.opCall ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second = 0,
int  ms = 0 
) [static]

Constructs a DateTime representing the given local date and time combination.

static DateTime smjg.libs.util.datetime.DateTime.opCall ( int  year,
int  month,
int  day,
int  hour,
int  minute,
float  second 
) [static]

Constructs a DateTime representing the given local date and time combination.

static DateTime smjg.libs.util.datetime.DateTime.now (  )  [static]

Retrieves the current system date and time.

Todo:
Implement on platforms other than Windows.

string smjg.libs.util.datetime.DateTime.format ( cstring  formatString  ) 

Formats this date and time according to a format string.

Parameters:
formatString the format string, as defined in smjg.libs.util.datetimeformat.
Returns:
the formatted date string.
Exceptions:
DateTimeFormatException if the formatting fails, e.g. because of an error in the format string.

real smjg.libs.util.datetime.DateTime.unixTime (  ) 

real smjg.libs.util.datetime.DateTime.unixTime ( real  ut  ) 

DateValue smjg.libs.util.datetime.DateTime.date (  ) 

The date component in local time.

DateValue smjg.libs.util.datetime.DateTime.date ( DateValue  d  ) 

The date component in local time.

TimeValue smjg.libs.util.datetime.DateTime.time (  ) 

The time component.

TimeValue smjg.libs.util.datetime.DateTime.time ( TimeValue  t  ) 

Sets the time component, adjusting the date if necessary to remain in the local time day.

int smjg.libs.util.datetime.DateTime.year (  ) 

MONTH smjg.libs.util.datetime.DateTime.month (  ) 

int smjg.libs.util.datetime.DateTime.day (  ) 

DAY_OF_WEEK smjg.libs.util.datetime.DateTime.dayOfWeek (  ) 

int smjg.libs.util.datetime.DateTime.hour (  ) 

int smjg.libs.util.datetime.DateTime.minute (  ) 

int smjg.libs.util.datetime.DateTime.second (  ) 

int smjg.libs.util.datetime.DateTime.millisecond (  ) 

string smjg.libs.util.datetime.DateTime.toString (  ) 

int smjg.libs.util.datetime.DateTime.opCmp ( DateTime  dt  ) 

Compares this date and time with another.

DateTime smjg.libs.util.datetime.DateTime.opAdd ( DateInterval  di  ) 

Adds the given date interval to the date component.

DateTime smjg.libs.util.datetime.DateTime.opAdd ( TimeInterval  ti  ) 

Adds the given time interval to this date and time.

DateTime smjg.libs.util.datetime.DateTime.opAdd ( DateTimeInterval  dti  ) 

Adds the given date and time interval to this date and time.

DateTime smjg.libs.util.datetime.DateTime.opSub ( DateInterval  di  ) 

Subtracts the given date interval from the date component.

DateTime smjg.libs.util.datetime.DateTime.opSub ( TimeInterval  ti  ) 

Subtracts the given time interval from this date and time.

DateTime smjg.libs.util.datetime.DateTime.opSub ( DateTimeInterval  dti  ) 

Subtracts the given date and time interval from this date and time.

DateTimeInterval smjg.libs.util.datetime.DateTime.opSub ( DateTime  dt  ) 

Determines the time interval between this and another DateTime.

DateTime smjg.libs.util.datetime.DateTime.opAddAssign ( DateInterval  di  ) 

Adds the given date interval to the date component.

DateTime smjg.libs.util.datetime.DateTime.opAddAssign ( TimeInterval  ti  ) 

Adds the given time interval to this date and time.

DateTime smjg.libs.util.datetime.DateTime.opAddAssign ( DateTimeInterval  dti  ) 

Adds the given date and time interval to this date and time.

DateTime smjg.libs.util.datetime.DateTime.opSubAssign ( DateInterval  di  ) 

Subtracts the given date interval from the date component.

DateTime smjg.libs.util.datetime.DateTime.opSubAssign ( TimeInterval  ti  ) 

Subtracts the given time interval from this date and time.

DateTime smjg.libs.util.datetime.DateTime.opSubAssign ( DateTimeInterval  dti  ) 

Subtracts the given date and time interval from this date and time.


Member Data Documentation

DateValue smjg.libs.util.datetime.DateTime.utcDate

The date component in UTC.

TimeValue smjg.libs.util.datetime.DateTime.utcTime

The time component.


The documentation for this struct was generated from the following file:
Generated on Sun Sep 13 19:50:35 2009 for Stewart's Utility Library by  doxygen 1.5.4