478 const char * formatPtr,
581 static struct tm *
os_localtime(
const time_t * clock,
struct tm * t);
582 static struct tm *
os_gmtime(
const time_t * clock,
struct tm * t);
599 #include "msos/ptlib/ptime.h"
601 #include "unix/ptlib/ptime.h"
606 #endif // PTLIB_TIME_H
PInt64 GetTimestamp() const
Get the total microseconds since the epoch.
Time without seconds.
Definition: ptime.h:423
PString AsString(TimeFormat formatCode=RFC1123, int zone=Local) const
Convert the time to a string representation.
int GetHour() const
Get the hour of the time.
static struct tm * os_gmtime(const time_t *clock, struct tm *t)
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:55
int GetMinute() const
Get the minute of the time.
static PBoolean GetTimeAMPM()
Get the internationalised time format: AM/PM or 24 hour.
Date is ordered year then day month then day.
Definition: ptime.h:570
Date is ordered day then month then year.
Definition: ptime.h:569
NameType
Flag for returning language dependent string names.
Definition: ptime.h:534
This class defines an absolute time and date.
Definition: ptime.h:53
Date is ordered month then day then year.
Definition: ptime.h:568
time_t GetTimeInSeconds() const
Get the total seconds since the epoch.
DateOrder
Possible orders for date components.
Definition: ptime.h:567
Date with abbreviated month names and time without seconds.
Definition: ptime.h:415
Internet standard format. (eg. Wed, 09 Feb 2011 11:25:58 +01:00)
Definition: ptime.h:401
static PString GetDayName(Weekdays dayOfWeek, NameType type=FullName)
Get the internationalised day of week day name (0=Sun etc).
Date with weekday, full month names and time with seconds.
Definition: ptime.h:409
Comparison
Result of the comparison operation performed by the Compare() function.
Definition: object.h:1184
static PString GetTimeAM()
Get the internationalised time AM string.
static DateOrder GetDateOrder()
Return the internationalised date order.
PTime & operator+=(const PTimeInterval &time)
Add the interval to the time changing the instance.
static struct tm * os_localtime(const time_t *clock, struct tm *t)
TimeZoneType
Flag for time zone adjustment on daylight savings.
Definition: ptime.h:319
Months
Month codes.
Definition: ptime.h:240
static int GetTimeZone()
Get the time zone offset in minutes.
TimeFormat
Standard time formats for string representations of a time and date.
Definition: ptime.h:399
PTime(time_t tsecs, long usecs=0)
Create a time object instance.
Definition: ptime.h:80
BOOL PBoolean
Definition: object.h:102
Weekdays
Days of the week.
Definition: ptime.h:270
Universal Coordinated Time.
Definition: ptime.h:65
Date with weekday, full month names and no time.
Definition: ptime.h:411
PTime & operator-=(const PTimeInterval &time)
Subtract the interval from the time changing the instance.
PTime()
Create a time object instance.
Definition: ptime.h:75
int GetYear() const
Get the year of the date.
Time with seconds.
Definition: ptime.h:413
Short form ISO standard format. (eg. 20110209T111108Z)
Definition: ptime.h:405
Date with numeric month and no time.
Definition: ptime.h:421
long microseconds
Definition: ptime.h:594
Months GetMonth() const
Get the month of the date.
Date with abbreviated month names and no time.
Definition: ptime.h:417
bool Parse(const PString &str)
Parse a string representation of time.
The character string class.
Definition: pstring.h:108
Another Internet standard format. (eg. 2011-02-09T11:14:41ZZ)
Definition: ptime.h:403
virtual Comparison Compare(const PObject &obj) const
Determine the relative rank of the specified times.
Local Time.
Definition: ptime.h:69
PTimeInterval operator-(const PTime &time) const
Calculate the difference between two times to get a time interval.
Weekdays GetDayOfWeek() const
Get the day of the week of the date.
Date with numeric month name and time without seconds.
Definition: ptime.h:419
virtual void PrintOn(ostream &strm) const
Output the time to the stream.
PTime operator+(const PTimeInterval &time) const
Add the interval to the time to yield a new time.
PBoolean IsPast() const
Determine if the time is in the past or in the future.
virtual void ReadFrom(istream &strm)
Input the time from the specified stream.
Greenwich Mean Time, effectively UTC.
Definition: ptime.h:67
static PBoolean IsDaylightSavings()
Get flag indicating daylight savings is current.
Epoch format (e.g. 1234476388.123456)
Definition: ptime.h:425
int GetDay() const
Get the day of the month of the date.
static PString GetTimeSeparator()
Get the internationalised time separator.
static PString GetDateSeparator()
Get the internationalised date separator.
int GetSecond() const
Get the second of the time.
void SetTimestamp(time_t seconds, long usecs=0)
Set the time in seconds and microseconds.
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
long GetMicrosecond() const
Get the microsecond part of the time.
int GetDayOfYear() const
Get the day in the year of the date.
PBoolean IsFuture() const
Determine if the time is in the past or in the future.
time_t theTime
Number of seconds since 1 January 1970.
Definition: ptime.h:593
Long form ISO standard format. (eg. 2011-02-09 T 11:13:06 Z)
Definition: ptime.h:407
static PString GetMonthName(Months month, NameType type=FullName)
Get the internationalised month name string (1=Jan etc).
PBoolean IsValid() const
Determine if the timestamp is valid.
static PString GetTimeZoneString(TimeZoneType type=StandardTime)
Get the text identifier for the local time zone .
void SetCurrentTime()
Set the the objects time with the current time in the current time zone.
static PString GetTimePM()
Get the internationalised time PM string.
PObject * Clone() const
Create a copy of the time on the heap.