This class defines an absolute time and date.
![]() | Construction |
![]() | Overrides from class PObject |
![]() | Access functions |
![]() | Time Zone configuration functions |
![]() | Operations |
![]() | String conversion functions |
![]() | Internationalisation functions |
![]() | theTime Number of seconds since 1 January 1970. |
Run Time Type functions
Comparison functions
I/O functions
Miscellaneous functions
This class defines an absolute time and date. It has a number of time and date rendering and manipulation functions. It is based on the standard C library functions for time. Thus it is based on a number of seconds since 1 January 1970.
PTime( time_t tsecs, long usecs = 0 )
PTime( const PString & str )
PTime( int second, int minute, int hour, int day, int month, int year, int tz = Local )
minute - Minute from 0 to 59.
hour - Hour from 0 to 23.
day - Day of month from 1 to 31.
month - Month from 1 to 12.
year - Year from 1970 to 2038
tz - local time or UTC
virtual Comparison Compare( const PObject & obj ) const
virtual void PrintOn( ostream & strm ) const
virtual void ReadFrom( istream & strm )
time_t GetTimeInSeconds() const
long GetMicrosecond() const
int GetSecond() const
int GetMinute() const
int GetHour() const
int GetDay() const
enum Months
Months GetMonth() const
int GetYear() const
enum Weekdays
Weekdays GetDayOfWeek() const
int GetDayOfYear() const
BOOL IsPast() const
BOOL IsFuture() const
enum TimeZoneType
static int GetTimeZone()
static int GetTimeZone( TimeZoneType type )
static PString GetTimeZoneString( TimeZoneType type = StandardTime )
PTime& operator+=( const PTimeInterval & time )
PTimeInterval operator-( const PTime & time ) const
PTime operator-( const PTimeInterval & time ) const
PTime& operator-=( const PTimeInterval & time )
LongDateTime
LongDate
LongTime
MediumDateTime
MediumDate
ShortDateTime
PString AsString( const PString & formatStr, int zone = Local ) const
zone - Time zone for the time.
static BOOL GetTimeAMPM()
static PString GetTimeAM()
static PString GetTimePM()
enum NameType
static PString GetDayName( Weekdays dayOfWeek, NameType type = FullName )
type - Flag for abbreviated or full name.static PString GetDateSeparator()
static PString GetMonthName( Months month, NameType type = FullName )
type - Flag for abbreviated or full name.enum DateOrder
static DateOrder GetDateOrder()
Alphabetic index HTML hierarchy of classes or Java