Click here to Skip to main content
15,895,084 members
Articles / Programming Languages / C++

Universal Time Converter

Rate me:
Please Sign up or sign in to vote.
4.29/5 (11 votes)
2 Jan 2006CPOL4 min read 99.3K   2.6K   31  
Illustrates converting time from universal time to local time and vice versa in C++
// DateTime.h: interface for the CDateTime class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DATETIME_H__894ED690_27B3_4970_85BC_6A5735DA197A__INCLUDED_)
#define AFX_DATETIME_H__894ED690_27B3_4970_85BC_6A5735DA197A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CDateTime  
{
public:
	CDateTime();

    CDateTime(WORD wYear, WORD wMonth, WORD wDayOfWeek, WORD wDay,
               WORD wHour, WORD wMinute =0, WORD wSecond = 0,WORD wMilliseconds =0);
	virtual ~CDateTime();

//operations
public:
    SetDateTime(WORD wYear, WORD wMonth, WORD wDayOfWeek, WORD wDay,
               WORD wHour, WORD wMinute =0, WORD wSecond = 0,WORD wMilliseconds =0);

//attributes
public:

    WORD m_wYear;
    WORD m_wMonth;
    WORD m_wDayOfWeek;
    WORD m_wDay;
    WORD m_wHour;
    WORD m_wMinute; 
    WORD m_wSecond;
    WORD m_wMilliseconds;


};

#endif // !defined(AFX_DATETIME_H__894ED690_27B3_4970_85BC_6A5735DA197A__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions