Unicorn XML Toolkit
Version 1.50.00

Namespace Core
Class CSystemTime

class CSystemTime {
public:
    CSystemTime();
    CSystemTime(const CSystemTime &source);
    CSystemTime(
        int nYear,
        int nMonth,
        int nDay,
        int nHours,
        int nMinutes,
        int nSeconds,
        int nMilliseconds);
    ~CSystemTime();
public:
    const CSystemTime &operator=(const CSystemTime &source);
    int GetYear();
    int GetMonth();
    int GetDay();
    int GetHours();
    int GetMinutes();
    int GetSeconds();
    int GetMilliseconds();
    void SetYear(int nYear);
    void SetMonth(int nMonth);
    void SetDay(int nDay);
    void SetHours(int nHours);
    void SetMinutes(int nMinutes);
    void SetSeconds(int nSeconds);
    void SetMilliseconds(int nMilliseconds);
public:
    void GetUtcTime();
    bool ToLocalTime();
    bool ToUtcTime();
    CString Format();
    CString Format(const WCHAR *pszFormat);
    bool Parse(const WCHAR *pszSource);
    bool Parse(const WCHAR *pszSource, const WCHAR *pszFormat);
    };

The system time.

Since:
1.00.00
Version:
1.50.00
Author:
Alexey Gokhberg
Constructor/Destructor Summary
CSystemTime ();
����������Constructs the system time object.
CSystemTime (const CSystemTime &source);
����������Constructs the system time object from another system time object.
CSystemTime (int nYear, int nMonth, int nDay, int nHours, int nMinutes, int nSeconds, int nMilliseconds);
����������Constructs the system time object from the specified components.
~CSystemTime ();
����������Destroys the system time object.

Function Summary
const�CSystemTime�& operator= (const CSystemTime &source);
����������Assigns the specified system time object to this system time object.
int GetYear ();
����������Returns a year component of this system time object.
int GetMonth ();
����������Returns a month component of this system time object.
int GetDay ();
����������Returns a day component of this system time object.
int GetHours ();
����������Returns an hours component of this system time object.
int GetMinutes ();
����������Returns a minutes component of this system time object.
int GetSeconds ();
����������Returns a seconds component of this system time object.
int GetMilliseconds ();
����������Returns a milliseconds component of this system time object.
void SetYear (int nYear);
����������Assigns a new value to the year component of this system time object.
void SetMonth (int nMonth);
����������Assigns a new value to the month component of this system time object.
void SetDay (int nDay);
����������Assigns a new value to the day component of this system time object.
void SetHours (int nHours);
����������Assigns a new value to the hours component of this system time object.
void SetMinutes (int nMinutes);
����������Assigns a new value to the minutes component of this system time object.
void SetSeconds (int nSeconds);
����������Assigns a new value to the seconds component of this system time object.
void SetMilliseconds (int nMilliseconds);
����������Assigns a new value to the milliseconds component of this system time object.
void GetUtcTime ();
����������Obtains current UTC time; assigns it as the new content to this system time object.
bool ToLocalTime ();
����������Extracts system time contained in this system time object; interprets it as UTC time; converts it to local time; assigns the conversion result as the new content of this system time object.
bool ToUtcTime ();
����������Extracts system time contained in this system time object; interprets it as local time; converts it to UTC time; assigns the conversion result as the new content of this system time object.
CString Format ();
����������Returns a string representation of this system time object using the default format.
CString Format (const WCHAR *pszFormat);
����������Returns a string representation of this system time object using the specified format.
bool Parse (const WCHAR *pszSource);
����������Parses the string representation of system time using the default format; assigns the result as the new content of this system time object.
bool Parse (const WCHAR *pszSource, const WCHAR *pszFormat);
����������Parses the string representation of system time using the specified format; assigns the result as the new content of this system time object.

Constructor/Destructor Detail

CSystemTime

CSystemTime();

Constructs the system time object.

CSystemTime

CSystemTime(const CSystemTime &source);

Constructs the system time object from another system time object.

Parameters:
source - the source system time object

CSystemTime

CSystemTime(
    int nYear,
    int nMonth,
    int nDay,
    int nHours,
    int nMinutes,
    int nSeconds,
    int nMilliseconds);

Constructs the system time object from the specified components.

Parameters:
nYear - the year
nMonth - the month (1-based)
nDay - the day of the month (1-based)
nHours - hours
nMinutes - minutes
nSeconds - seconds
nMilliseconds - milliseconds

~CSystemTime

~CSystemTime();

Destroys the system time object.

Function Detail

operator=

const CSystemTime &operator=(const CSystemTime &source);

Assigns the specified system time object to this system time object.

Parameters:
source - the source system time object to assign
Returns:
this system time object

GetYear

int GetYear();

Returns a year component of this system time object.

Returns:
the year component of this system time object

GetMonth

int GetMonth();

Returns a month component of this system time object.

Returns:
the month component of this system time object (1-based)

GetDay

int GetDay();

Returns a day component of this system time object.

Returns:
the day component of this system time object (1-based)

GetHours

int GetHours();

Returns an hours component of this system time object.

Returns:
the hours component of this system time object

GetMinutes

int GetMinutes();

Returns a minutes component of this system time object.

Returns:
the minutes component of this system time object

GetSeconds

int GetSeconds();

Returns a seconds component of this system time object.

Returns:
the seconds component of this system time object

GetMilliseconds

int GetMilliseconds();

Returns a milliseconds component of this system time object.

Returns:
the milliseconds component of this system time object

SetYear

void SetYear(int nYear);

Assigns a new value to the year component of this system time object.

Parameters:
nYear - the new value for the year component of this system time object

SetMonth

void SetMonth(int nMonth);

Assigns a new value to the month component of this system time object.

Parameters:
nMonth - the new value for the month component of this system time object (1-based)

SetDay

void SetDay(int nDay);

Assigns a new value to the day component of this system time object.

Parameters:
nDay - the new value for the day component of this system time object (1-based)

SetHours

void SetHours(int nHours);

Assigns a new value to the hours component of this system time object.

Parameters:
nHours - the new value for the hours component of this system time object

SetMinutes

void SetMinutes(int nMinutes);

Assigns a new value to the minutes component of this system time object.

Parameters:
nMinutes - the new value for the minutes component of this system time object

SetSeconds

void SetSeconds(int nSeconds);

Assigns a new value to the seconds component of this system time object.

Parameters:
nSeconds - the new value for the seconds component of this system time object

SetMilliseconds

void SetMilliseconds(int nMilliseconds);

Assigns a new value to the milliseconds component of this system time object.

Parameters:
nMilliseconds - the new value for the milliseconds component of this system time object

GetUtcTime

void GetUtcTime();

Obtains current UTC time; assigns it as the new content to this system time object.

ToLocalTime

bool ToLocalTime();

Extracts system time contained in this system time object; interprets it as UTC time; converts it to local time; assigns the conversion result as the new content of this system time object.

Returns:
true if convesion succeeded; false otherwise

ToUtcTime

bool ToUtcTime();

Extracts system time contained in this system time object; interprets it as local time; converts it to UTC time; assigns the conversion result as the new content of this system time object.

Returns:
true if convesion succeeded; false otherwise

Format

CString Format();

Returns a string representation of this system time object using the default format.

The default format is platform-dependent and locale-dependent.

Returns:
the string representation of this system time object using the default format

Format

CString Format(const WCHAR *pszFormat);

Returns a string representation of this system time object using the specified format.

The format specification is a string which consists of two parts. The first part represents the date format and has syntax specified for the fourth argument of the GetDateFormat function of Windows API. The second part represents the time format and has syntax as specified the fourth argument of the GetTimeFormat function of Windows API. There is no separator between two parts.

Parameters:
pszFormat - the fomat string
Returns:
the string representation of this system time object using the specified format

Parse

bool Parse(const WCHAR *pszSource);

Parses the string representation of system time using the default format; assigns the result as the new content of this system time object.

This function is not supported in the current release of the toolkit.

Parameters:
pszSource - the source string to parse
Returns:
true if parsing succeeded; false otherwise

Parse

bool Parse(const WCHAR *pszSource, const WCHAR *pszFormat);

Parses the string representation of system time using the specified format; assigns the result as the new content of this system time object.

This function is not fully implemented in the current release. It requires the source format "dd/MM/yy hh:mm:ss" , where the actual number of digits in each component may vary. The format string actually supplied is ignored.

Parameters:
pszSource - the source string to parse
pszFormat - the format string
Returns:
true if parsing succeeded; false otherwise

Unicorn XML Toolkit
Version 1.50.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.