// CurrentMsTime.h: interface for the CCurrentMsTime class. // ////////////////////////////////////////////////////////////////////// #pragma once #include "DllDefines.h" // Note : this class might not work after year 2038! // this is because _ftime() returns a long data type since midnight(00:00:00), January 1, 1970 // The long data type will become a negative value after 2038AD // long data type is 32 bit // 32 bit value = 2^32 = 4294967296 // Max long data type positive value = (32 bit value / 2) - 1 = (4294967296 / 2) - 1 // = 2147483647 // secs in a year = 24hrs * 60Min * 60sec * 365.25 days = 31557600 secs // No of years long data type can represent = Max long data type positive value/secs in a year // = 2147483647 / 31557600 = 68 years // Therefore Max year a long data type can represent since midnight(00:00:00), January 1, 1970 // = 1970 + 68 = 2038 AD // By 2038AD i should have retired! Have u? class MCCTRDLLCLASS CCurrentMsTime { public: // Update Current Time static void UpdateCurrentTime(); // get current time static LONGLONG GetCurrentTime(); // get time in seconds static double CalTimeSpanInSec(LONGLONG ullMsTime); // get time in minutes static double CalTimeSpanInMin(LONGLONG ullMsTime); // get time in hours static double CalTimeSpanInHr(LONGLONG ullMsTime); private: // private constructor, this class should not be instantiated CCurrentMsTime(); // default destructor virtual ~CCurrentMsTime(); // Current Time static LONGLONG m_lCurrentTime; };