![]() | InDesign SDK 20.5 |
#include <GlobalTime.h>
Public Types | |
| enum | { kOneSecond = 10000000 } |
| typedef object_type | data_type |
Public Member Functions | |
| GlobalTime (uint64 time) | |
| void | SetTime (uint64 time) |
| int32 | SetTime (int32 year, int32 month, int32 day, int32 hour, int32 minute, int32 second) |
| uint64 | GetTime () const |
| int32 | GetTime (int32 *year, int32 *month, int32 *day, int32 *hour, int32 *minute, int32 *second, int32 *dayOfWeek=nil) const |
| void | CurrentTime () |
| int32 | DateToString (PMString &s, bool16 shortform) const |
| int32 | TimeToString (PMString &s) const |
| void | ReadWrite (IPMStream *s) |
| bool16 | IsHistory (uint64 timeinterval) const |
| bool16 | operator== (const GlobalTime >) const |
| bool16 | operator!= (const GlobalTime >) const |
| bool16 | operator< (const GlobalTime >) const |
| bool16 | operator> (const GlobalTime >) const |
NOTE: Do not use GlobalTime for new code, please use IDTime instead. GlobalTime has problems with time on the Mac due to the way daylight savings time is handled.
GlobalTime provides time features in a core way.
GlobalTime is based on a uint64 bit number. It matches NT's FILETIME, the number of 100 nanoseconds since January 1, 1601, and it is UTC based.
| anonymous enum |
Value that represents one second.
| inline |
Method to set the stored time to the specified time value.
| time | is the value to set. It is equivalent to NT's FILETIME. |
| void GlobalTime::CurrentTime | ( | ) |
Method to set the stored time to the current time.
| int32 GlobalTime::DateToString | ( | PMString & | s, |
| bool16 | shortform | ||
| ) | const |
Method to get a date string that represents the stored GlobalTime. The string returned is dependent on your system and system's settings.
| s | is the string to fill in. |
| shortform | is true then you get a short date string, otherwise you get a long date string. |
| inline |
Method to get the uint64 GlobalTime value.
| int32 GlobalTime::GetTime | ( | int32 * | year, |
| int32 * | month, | ||
| int32 * | day, | ||
| int32 * | hour, | ||
| int32 * | minute, | ||
| int32 * | second, | ||
| int32 * | dayOfWeek = nil | ||
| ) | const |
Method to get the time components that the GlobalTime represents. All parameters are optional, pass nil when you do not want a value. See SetTime for the parameter meanings.
| year | value to get |
| month | value to get |
| day | value to get |
| hour | value to get |
| minute | value to get |
| second | value to get |
| day | of week (e.g. Tuesday) value to get (1 = Sunday.. 7 = Saturday) |
| bool16 GlobalTime::IsHistory | ( | uint64 | timeinterval | ) | const |
Method to determine whether the stored time plus the specified time is in the past.
| timeinterval | is the time value to add to the current stored time. You can use kOneSecond for the timeinterval parameter. |
| inline |
Method to determine whether two GlobalTime values are not equal.
| inline |
Method to determine whether two GlobalTime values are less than each other.
| inline |
Method to determine whether two GlobalTime values are equal.
| inline |
Method to determine whether two GlobalTime values are greater than each other.
| void GlobalTime::ReadWrite | ( | IPMStream * | s | ) |
Method to stream out the GlobalTime value.
| s | is the stream to write to. |
| inline |
Method to set the stored time to the specified time value.
| time | is the value to set. It is equivalent to NT's FILETIME. |
| int32 GlobalTime::SetTime | ( | int32 | year, |
| int32 | month, | ||
| int32 | day, | ||
| int32 | hour, | ||
| int32 | minute, | ||
| int32 | second | ||
| ) |
Method to set the stored time to the specified time value.
| year | is a year value, for example 2005. The year must be greater than 1601. |
| month | is a value from 1 to 12, where January = 1, February = 2, and so on. |
| day | is the day of the week. A value from 0 to 6 where Sunday = 0, Monday = 1, and so on. |
| hour | is the current hour in 24 hour time. |
| minute | is the current minute. |
| second | is the current second. |
| int32 GlobalTime::TimeToString | ( | PMString & | s | ) | const |
Method to get a time string that represents the stored GlobalTime. The string returned is dependent on your system and system's settings.
| s | is the string to fill in. |