C# Class Kimono.KDateTime

Inheritance: Object, IDisposable
ファイルを表示 Open project: 0xd34df00d/Qross Class Usage Examples

Protected Properties

Property Type Description
interceptor Qyoto.SmokeInvocation

Public Methods

Method Description
AddDays ( int days ) : KDateTime Returns a date/time days days later than the stored date/time. The result is expressed using the same time specification as the original instance. Note that if the instance is a local clock time (type ClockTime), any daylight savings changes or time zone changes during the period may render the result inaccurate.
AddMSecs ( long msecs ) : KDateTime Returns a date/time msecs milliseconds later than the stored date/time. Except when the instance is a local clock time (type ClockTime), the calculation is done in UTC to ensure that the result takes proper account of clock changes (e.g. daylight savings) in the time zone. The result is expressed using the same time specification as the original instance. Note that if the instance is a local clock time (type ClockTime), any daylight savings changes or time zone changes during the period will render the result inaccurate. If the instance is date-only, msecs is rounded down to a whole number of days and that value is added to the date to find the result.
AddMonths ( int months ) : KDateTime Returns a date/time months months later than the stored date/time. The result is expressed using the same time specification as the original instance. Note that if the instance is a local clock time (type ClockTime), any daylight savings changes or time zone changes during the period may render the result inaccurate.
AddSecs ( long secs ) : KDateTime Returns a date/time secs seconds later than the stored date/time. Except when the instance is a local clock time (type ClockTime), the calculation is done in UTC to ensure that the result takes proper account of clock changes (e.g. daylight savings) in the time zone. The result is expressed using the same time specification as the original instance. Note that if the instance is a local clock time (type ClockTime), any daylight savings changes or time zone changes during the period will render the result inaccurate. If the instance is date-only, secs is rounded down to a whole number of days and that value is added to the date to find the result.
AddYears ( int years ) : KDateTime Returns a date/time years years later than the stored date/time. The result is expressed using the same time specification as the original instance. Note that if the instance is a local clock time (type ClockTime), any daylight savings changes or time zone changes during the period may render the result inaccurate.
Compare ( KDateTime other ) : KDateTime.Comparison Compare this instance with another to determine whether they are simultaneous, earlier or later, and in the case of date-only values, whether they overlap (i.e. partly coincide but are not wholly simultaneous). The comparison takes time zones into account: if the two instances have different time zones, they are first converted to UTC before comparing. If both instances are date/time values, this instance is considered to be either simultaneous, earlier or later, and does not overlap. If one instance is date-only and the other is a date/time, this instance is either strictly earlier, strictly later, or overlaps. If both instance are date-only, they are considered simultaneous if both their start of day and end of day times are simultaneous with each other. (Both start and end of day times need to be considered in case a daylight savings change occurs during that day.) Otherwise, this instance can be strictly earlier, earlier but overlapping, later but overlapping, or strictly later. Note that if either instance is a local clock time (type ClockTime), the result cannot be guaranteed to be correct, since by definition they contain no information about time zones or daylight savings changes.
CurrentDateTime ( KDateTime spec ) : KDateTime Returns the current date and time, as reported by the system clock, expressed in a given time specification. name="spec" time specification
CurrentLocalDateTime ( ) : KDateTime Returns the current date and time, as reported by the system clock, expressed in the local system time zone.
CurrentUtcDateTime ( ) : KDateTime Returns the current date and time, as reported by the system clock, expressed in UTC.
Date ( ) : QDate Returns the date part of the date/time. The value returned should be interpreted in terms of the instance's time zone or UTC offset.
DateTime ( ) : Qyoto.QDateTime Returns the date/time component of the instance, ignoring the time zone. The value returned should be interpreted in terms of the instance's time zone or UTC offset. The returned value's timeSpec() value will be Qt.UTC if the instance is a UTC time, else Qt.LocalTime. If the instance is date-only, the time value is set to 00:00:00.
DaysTo ( KDateTime other ) : int Calculates the number of days from this date/time to the other date/time. In calculating the result, other is first converted to this instance's time zone. The number of days difference is then calculated ignoring the time parts of the two date/times. For example, if this date/time was 13:00 on 1 January 2000, and other was 02:00 on 2 January 2000, the result would be 1. Note that if either instance is a local clock time (type ClockTime), the result cannot be guaranteed to be accurate, since by definition they contain no information about time zones or daylight savings changes. If one instance is date-only and the other is date-time, the date-time value is first converted to the same time specification as the date-only value, and the result is the difference in days between the resultant date and the date-only date. If both instances are date-only, the calculation ignores time zones. name="other" other date/time
Detach ( ) : void Check whether this date/time is earlier than another. The comparison takes time zones into account: if the two instances have different time zones, they are first converted to UTC before comparing. Note that if either instance is a local clock time (type ClockTime), the result cannot be guaranteed to be correct, since by definition they contain no information about time zones or daylight savings changes. If one or both instances are date-only, the comparison returns true if this date/time or day, falls wholly before the other date/time or day. To achieve this, the time used in the comparison is the end of day (if this instance is date-only) or the start of day (if the other instance is date-only).Create a separate copy of this instance's data if it is implicitly shared with another instance. You would normally only call this if you want different copies of the same date/time value to cache conversions to different time zones. Because only the last conversion to another time zone is cached, and the cached value is implicitly shared, judicious use of detach() could improve efficiency when handling several time zones. But take care: if used inappropriately, it will reduce efficiency!
Dispose ( ) : void
Equals ( object o ) : bool Check whether this date/time is simultaneous with another. The comparison takes time zones into account: if the two instances have different time zones, they are first converted to UTC before comparing. Note that if either instance is a local clock time (type ClockTime), the result cannot be guaranteed to be correct, since by definition they contain no information about time zones or daylight savings changes. If both instances are date-only, they are considered simultaneous if both their start of day and end of day times are simultaneous with each other. (Both start and end of day times need to be considered in case a daylight saving change occurs during that day.)
FromString ( string arg1 ) : KDateTime
FromString ( string arg1, KDateTime format ) : KDateTime
FromString ( string arg1, KDateTime format, bool &negZero ) : KDateTime Returns the KDateTime represented by string, using the format given. This method is the inverse of , except that it can only return a time specification of UTC, OffsetFromUTC or ClockTime. An actual named time zone cannot be returned since an offset from UTC only partially specifies a time zone. The time specification of the result is determined by the UTC offset present in the string: - if the UTC offset is zero the result is type UTC. - if the UTC offset is non-zero, the result is type OffsetFromUTC. - if there is no UTC offset, the result is by default type ClockTime. You can use setFromStringDefault() to change this default. If no time is found in string, a date-only value is returned, except when the specified format does not permit the time to be omitted, in which case an error is returned. An error is therefore returned for ISODate when string includes a time zone specification, and for RFCDate in all cases. For RFC format strings, you should normally set format to RFCDate. Only set it to RFCDateDay if you want to return an error when the day of the week is omitted. For format = ISODate or RFCDate[Day], if an invalid KDateTime is returned, you can check why format was considered invalid by use of outOfRange(). If that method returns true, it indicates that format was in fact valid, but the date lies outside the range which can be represented by QDate. name="string" string to convert name="format" format code. LocalDate cannot be used here. name="negZero" if non-null, the value is set to true if a UTC offset of '-0000' is found or, for RFC 2822 format, an unrecognised or invalid time zone abbreviation is found, else false.
FromString ( string arg1, string format ) : KDateTime
FromString ( string arg1, string format, Kimono.KTimeZones zones ) : KDateTime
FromString ( string arg1, string format, Kimono.KTimeZones zones, bool offsetIfAmbiguous ) : KDateTime Returns the KDateTime represented by string, using the format given, optionally using a time zone collection zones as the source of time zone definitions. The format codes are basically the same as those for toString(), and are similar but not identical to those used by strftime(3). The format string consists of the same codes as that for toString(). However, some codes which are distinct in toString() have the same function as each other here. Numeric values without a stated number of digits permit, but do not require, leading zeroes. The maximum number of digits consumed by a numeric code is the minimum needed to cover the possible range of the number (e.g. for minutes, the range is 0 - 59, so the maximum number of digits consumed is 2). All non-numeric values are case insensitive. ate - %y year excluding century (0 - 99). Years 0 - 50 return 2000 - 2050, while years 51 - 99 return 1951 - 1999. - %Y full year number (4 digits with optional sign) - %:Y full year number (>= 4 digits with optional sign) - %:m month number (1 - 12) - %m month number, 2 digits (01 - 12) - %b - %B month name in the current locale or, if no match, in English, abbreviated or in full - %:b - %:B month name in English, abbreviated or in full - %e day of the month (1 - 31) - %d day of the month, 2 digits (01 - 31) - %a - %A weekday name in the current locale or, if no match, in English, abbreviated or in full - %:a - %:A weekday name in English, abbreviated or in full ime - %H hour in the 24 hour clock, 2 digits (00 - 23) - %k hour in the 24 hour clock (0 - 23) - %I hour in the 12 hour clock, 2 digits (01 - 12) - %l hour in the 12 hour clock (1 - 12) - %M minute, 2 digits (00 - 59) - %:M minute (0 - 59) - %S seconds, 2 digits (00 - 59) - %s seconds (0 - 59) - %:S optional seconds value (0 - 59) preceded with ':'. If no colon is found in string, no input is consumed and the seconds value is set to zero. - %:s fractional seconds value, preceded with a decimal point (either '.' or the locale's decimal point symbol) - %P - %p "am" or "pm", in the current locale or, if no match, in English. This format is only useful when used with %I or %l. - %:P - %:p "am" or "pm" in English. This format is only useful when used with %I or %l. ime zone - %:u - %z UTC offset of the time zone in hours and optionally minutes, e.g. -02, -0200. - %:z UTC offset of the time zone in hours and minutes, colon separated, e.g. +02:00. - %Z time zone abbreviation, consisting of alphanumeric characters, e.g. UTC, EDT, GMT. - %:Z time zone name, e.g. Europe/London. The name may contain any characters and is delimited by the following character in the format string. It will not work if you follow %:Z with another escape sequence (except %% or %t). ther - %t matches one or more whitespace characters - %% literal '%' character Any other character must have a matching character in string, except that a space will match zero or more whitespace characters in the input string. If any time zone information is present in the string, the function attempts to find a matching time zone in the zones collection. A time zone name (format code %:Z) will provide an unambiguous look up in zones. Any other type of time zone information (an abbreviated time zone code (%Z) or UTC offset (%z, %:z, %:u) is searched for in zones and if only one time zone is found to match, the result is set to that zone. Otherwise: - If more than one match of a UTC offset is found, the action taken is determined by offsetIfAmbiguous: if offsetIfAmbiguous is true, a local time with an offset from UTC (type OffsetFromUTC) will be returned; if false an invalid KDateTime is returned. - If more than one match of a time zone abbreviation is found, the UTC offset for each matching time zone is compared and, if the offsets are the same, a local time with an offset from UTC (type OffsetFromUTC) will be returned provided that offsetIfAmbiguous is true. Otherwise an invalid KDateTime is returned. - If a time zone abbreviation does not match any time zone in zones, or the abbreviation does not apply at the parsed date/time, an invalid KDateTime is returned. - If a time zone name does not match any time zone in zones, an invalid KDateTime is returned. - If the time zone UTC offset does not match any time zone in zones, a local time with an offset from UTC (type OffsetFromUTC) is returned. If format contains more than one time zone or UTC offset code, an error is returned. If no time zone information is present in the string, by default a local clock time (type ClockTime) is returned. You can use setFromStringDefault() to change this default. If no time is found in string, a date-only value is returned. If any inconsistencies are found, i.e. the same item of information appears more than once but with different values, the weekday name does not tally with the date, an invalid KDateTime is returned. If an invalid KDateTime is returned, you can check why format was considered invalid by use of outOfRange(). If that method returns true, it indicates that format was in fact valid, but the date lies outside the range which can be represented by QDate. name="string" string to convert name="format" format string name="zones" time zone collection, or null for none name="offsetIfAmbiguous" specifies what to do if more than one zone matches the UTC offset found in the string. Ignored if zones is null.
GetHashCode ( ) : int
IsClockTime ( ) : bool Returns whether the date/time is a local clock time.
IsDateOnly ( ) : bool Returns whether the instance represents a date/time or a date-only value.
IsLocalZone ( ) : bool Returns whether the time zone for the date/time is the current local system time zone.
IsNull ( ) : bool Returns whether the date/time is null.
IsOffsetFromUtc ( ) : bool Returns whether the date/time is a local time at a fixed offset from UTC.
IsSecondOccurrence ( ) : bool Returns whether the date/time is the second occurrence of this time. This is only applicable to a date/time expressed in terms of a time zone (type TimeZone or LocalZone), around the time of change from daylight savings to standard time. When a shift from daylight savings time to standard time occurs, the local times (typically the previous hour) immediately preceding the shift occur twice. For example, if a time shift of 1 hour happens at 03:00, the clock jumps backwards to 02:00, so the local times between 02:00:00 and 02:59:59 occur once before the shift, and again after the shift. For instances which are not of type TimeZone, or when the date/time is not near to a time shift, false is returned.
IsUtc ( ) : bool Returns whether the date/time is a UTC time. It is considered to be a UTC time if it either has a UTC time specification (SpecType == UTC), or has a zero offset from UTC (SpecType == OffsetFromUTC with zero UTC offset).
IsValid ( ) : bool Returns whether the date/time is valid.
KDateTime ( KDateTime other ) : System
KDateTime ( QDate date ) : System
KDateTime ( QDate date, KDateTime spec ) : System Constructs a date-only value expressed in a given time specification. The time is set to 00:00:00. The instance is initialised according to the time specification type of spec as follows: - UTC : date is stored as UTC. - OffsetFromUTC : date is a local time at the specified offset from UTC. - TimeZone : date is a local time in the specified time zone. - LocalZone : date is a local date in the current system time zone. - ClockTime : time zones are ignored. name="date" date in the time zone indicated by spec name="spec" time specification
KDateTime ( QDate date, Qyoto.QTime time ) : System
KDateTime ( QDate date, Qyoto.QTime time, KDateTime spec ) : System Constructs a date/time expressed as specified by spec. date and time are interpreted and stored according to the value of spec as follows: - UTC : date and time are in UTC. - OffsetFromUTC : date/time is a local time at the specified offset from UTC. - TimeZone : date/time is a local time in the specified time zone. - LocalZone : date and time are local times in the current system time zone. - ClockTime : time zones are ignored. name="date" date in the time zone indicated by spec name="time" time in the time zone indicated by spec name="spec" time specification
KDateTime ( Qyoto.QDateTime dt ) : System Constructs a date/time from a QDateTime. The KDateTime is expressed in either UTC or the local system time zone, according to dt.timeSpec(). name="dt" date and time
KDateTime ( Qyoto.QDateTime dt, KDateTime spec ) : System Constructs a date/time expressed in a given time specification. dt is interpreted and stored according to the time specification type of spec as follows: - UTC : dt is stored as a UTC value. If dt.timeSpec() is Qt.LocalTime, dt is first converted from the current system time zone to UTC before storage. - OffsetFromUTC : date/time is stored as a local time at the specified offset from UTC. If dt.timeSpec() is Qt.UTC, the time is adjusted by the UTC offset before storage. If dt.timeSpec() is Qt.LocalTime, it is assumed to be a local time at the specified offset from UTC, and is stored without adjustment. - TimeZone : if dt is specified as a UTC time (i.e. dt.timeSpec() is Qt.UTC), it is first converted to local time in specified time zone before being stored. - LocalZone : dt is stored as a local time in the current system time zone. If dt.timeSpec() is Qt.UTC, dt is first converted to local time before storage. - ClockTime : If dt.timeSpec() is Qt.UTC, dt is first converted to local time in the current system time zone before storage. After storage, the time is treated as a simple clock time, ignoring time zones. name="dt" date and time name="spec" time specification
OutOfRange ( ) : bool Checks whether the date/time returned by the last call to fromString() was invalid because an otherwise valid date was outside the range which can be represented by QDate. This status occurs when fromString() read a valid string containing a year earlier than -4712 (4713 BC). On exit from fromString(), if outOfRange() returns true, isValid() will return false.
SecsTo ( KDateTime other ) : int Returns the number of seconds from this date/time to the other date/time. Before performing the comparison, the two date/times are converted to UTC to ensure that the result is correct if one of the two date/times has daylight saving time (DST) and the other doesn't. The exception is when both instances are local clock time, in which case no conversion to UTC is done. Note that if either instance is a local clock time (type ClockTime), the result cannot be guaranteed to be accurate, since by definition they contain no information about time zones or daylight savings changes. If one instance is date-only and the other is date-time, the date-time value is first converted to the same time specification as the date-only value, and the result is the difference in days between the resultant date and the date-only date. If both instances are date-only, the result is the difference in days between the two dates, ignoring time zones. name="other" other date/time
SecsTo_long ( KDateTime other ) : long Returns the number of seconds from this date/time to the other date/time. Before performing the comparison, the two date/times are converted to UTC to ensure that the result is correct if one of the two date/times has daylight saving time (DST) and the other doesn't. The exception is when both instances are local clock time, in which case no conversion to UTC is done. Note that if either instance is a local clock time (type ClockTime), the result cannot be guaranteed to be accurate, since by definition they contain no information about time zones or daylight savings changes. If one instance is date-only and the other is date-time, the date-time value is first converted to the same time specification as the date-only value, and the result is the difference in days between the resultant date and the date-only date. If both instances are date-only, the result is the difference in days between the two dates, ignoring time zones. name="other" other date/time
SetDate ( QDate date ) : void Sets the date part of the date/time. name="date" new date value
SetDateOnly ( bool dateOnly ) : void Sets the instance either to being a date and time value, or a date-only value. If its status is changed to date-only, its time is set to 00:00:00. name="dateOnly" true to set to date-only, false to set to date and time.
SetDateTime ( Qyoto.QDateTime dt ) : void Sets the date/time part of the instance, leaving the time specification unaffected. If dt is a local time (
 dt.timeSpec() == Qt.LocalTime 
) and the instance is UTC, dt is first converted from the current system time zone to UTC before being stored. If the instance was date-only, it is changed to being a date and time value. name="dt" date and time
SetFromStringDefault ( KDateTime spec ) : void Sets the default time specification for use by fromString() when no time zone or UTC offset is found in the string being parsed, or when "-0000" is found in an RFC 2822 string. By default, fromString() returns a local clock time (type ClockTime) when no definite zone or UTC offset is found. You can use this method to make it return the local time zone, UTC, or whatever you wish. name="spec" the new default time specification
SetSecondOccurrence ( bool second ) : void Sets whether the date/time is the second occurrence of this time. This is only applicable to a date/time expressed in terms of a time zone (type TimeZone or LocalZone), around the time of change from daylight savings to standard time. When a shift from daylight savings time to standard time occurs, the local times (typically the previous hour) immediately preceding the shift occur twice. For example, if a time shift of 1 hour happens at 03:00, the clock jumps backwards to 02:00, so the local times between 02:00:00 and 02:59:59 occur once before the shift, and again after the shift. For instances which are not of type TimeZone, or when the date/time is not near to a time shift, calling this method has no effect. Note that most other setting methods clear the second occurrence indicator, so if you want to retain its setting, you must call setSecondOccurrence() again after changing the instance's value. name="second" true to set as the second occurrence, false to set as the first occurrence
SetTime ( Qyoto.QTime time ) : void Sets the time part of the date/time. If the instance was date-only, it is changed to being a date and time value. name="time" new time value
SetTimeSpec ( KDateTime spec ) : void Changes the time specification of the instance. Any previous time zone is forgotten. The stored date/time component of the instance is left unchanged (except that its UTC/local time setting is set to correspond with spec). Usually this method will change the absolute time which this instance represents. name="spec" new time specification
SetTime_t ( long seconds ) : void Sets the time to a UTC time, specified as seconds since 00:00:00 UTC 1st January 1970 (as returned by time(2)). name="seconds" number of seconds since 00:00:00 UTC 1st January 1970
Time ( ) : Qyoto.QTime Returns the time part of the date/time. The value returned should be interpreted in terms of the instance's time zone or UTC offset. If the instance is date-only, the time returned is 00:00:00.
TimeSpec ( ) : KDateTime.Spec Returns the time specification of the date/time, i.e. whether it is UTC, what time zone it is, etc.
TimeType ( ) : KDateTime.SpecType Returns the time specification type of the date/time, i.e. whether it is UTC, has a time zone, etc. If the type is the local time zone, TimeZone is returned; use isLocalZone() to check for the local time zone.
TimeZone ( ) : KTimeZone Returns the time zone for the date/time. If the date/time is specified as a UTC time, a UTC time zone is always returned.
ToClockTime ( ) : KDateTime Returns the time converted to the local clock time. The time is first converted to the local system time zone before setting its type to ClockTime, i.e. no associated time zone. If the instance is a date-only value, a date-only clock time value is returned, with the date unchanged.
ToLocalZone ( ) : KDateTime Returns the time converted to the current local system time zone. If the instance is a date-only value, a date-only local time zone value is returned, with the date unchanged.
ToOffsetFromUtc ( ) : KDateTime Returns the time expressed as an offset from UTC, using the UTC offset associated with this instance's date/time. The date and time components are unchanged. For example, 14:15 on 12 Jan 2001, US Eastern time zone would return a KDateTime value of 14:15 on 12 Jan 2001 with a UTC offset of -18000 seconds (i.e. -5 hours). If the instance is a local clock time, the offset is set to that of the local time zone. If the instance is a date-only value, the offset is set to that at the start of the day.
ToOffsetFromUtc ( int utcOffset ) : KDateTime Returns the time expressed as a specified offset from UTC. If the instance is a local clock time, it is first set to the local time zone, and then converted to the UTC offset. If the instance is a date-only value, a date-only clock time value is returned, with the date unchanged. name="utcOffset" number of seconds to add to UTC to get the local time.
ToString ( ) : string
ToString ( KDateTime format ) : string Returns the date/time as a string, formatted according to the format parameter, with the UTC offset appended. Note that if the instance has a time specification of ClockTime, the UTC offset in the result will be blank, except for RFC 2822 format in which it will be the offset for the local system time zone. If the instance is date-only, the time will when format permits be omitted from the output string. This applies to format = QtTextDate or LocalDate. It also applies to format = ISODate when the instance has a time specification of ClockTime. For all other cases, a time of 00:00:00 will be output. For RFC 2822 format, set format to RFCDateDay to include the day of the week, or to RFCDate to omit it. name="format" format for output string
ToString ( string format ) : string Returns the date/time as a string. The format parameter determines the format of the result string. The format codes used for the date and time components follow those used elsewhere in KDE, and are similar but not identical to those used by strftime(3). Conversion specifiers are introduced by a '%' character, and are replaced in format as follows: ate - %y 2-digit year excluding century (00 - 99). Conversion is undefined if year < 0. - %Y full year number - %:m month number, without leading zero (1 - 12) - %m month number, 2 digits (01 - 12) - %b abbreviated month name in current locale - %B full month name in current locale - %:b abbreviated month name in English (Jan, Feb, ...) - %:B full month name in English - %e day of the month (1 - 31) - %d day of the month, 2 digits (01 - 31) - %a abbreviated weekday name in current locale - %A full weekday name in current locale - %:a abbreviated weekday name in English (Mon, Tue, ...) - %:A full weekday name in English ime - %H hour in the 24 hour clock, 2 digits (00 - 23) - %k hour in the 24 hour clock, without leading zero (0 - 23) - %I hour in the 12 hour clock, 2 digits (01 - 12) - %l hour in the 12 hour clock, without leading zero (1 - 12) - %M minute, 2 digits (00 - 59) - %S seconds (00 - 59) - %:S seconds preceded with ':', but omitted if seconds value is zero - %:s milliseconds, 3 digits (000 - 999) - %P "am" or "pm" in the current locale, or if undefined there, in English - %p "AM" or "PM" in the current locale, or if undefined there, in English - %:P "am" or "pm" - %:p "AM" or "PM" ime zone - %:u UTC offset of the time zone in hours, e.g. -02. If the offset is not a whole number of hours, the output is the same as for '%U'. - %z UTC offset of the time zone in hours and minutes, e.g. -0200. - %:z UTC offset of the time zone in hours and minutes, e.g. +02:00. - %Z time zone abbreviation, e.g. UTC, EDT, GMT. This is not guaranteed to be unique among different time zones. If not applicable (i.e. if the instance is type OffsetFromUTC), the UTC offset is substituted. - %:Z time zone name, e.g. Europe/London. This is system dependent. If not applicable (i.e. if the instance is type OffsetFromUTC), the UTC offset is substituted. ther - %% literal '%' character Note that if the instance has a time specification of ClockTime, the time zone or UTC offset in the result will be blank. If you want to use the current locale's date format, you should call KLocale.FormatDate() to format the date part of the KDateTime. name="format" format for the string
ToTimeSpec ( KDateTime spec ) : KDateTime Returns the time converted to a new time specification. If the instance is a local clock time, it is first set to the local time zone, and then converted to the spec time specification. If the instance is a date-only value, a date-only value is returned, with the date unchanged. name="spec" new time specification
ToTime_t ( ) : uint Converts the time to a UTC time, measured in seconds since 00:00:00 UTC 1st January 1970 (as returned by time(2)).
ToUtc ( ) : KDateTime Returns the time converted to UTC. The converted time has a UTC offset of zero. If the instance is a local clock time, it is first set to the local time zone, and then converted to UTC. If the instance is a date-only value, a date-only UTC value is returned, with the date unchanged.
ToZone ( KTimeZone zone ) : KDateTime Returns the time converted to a specified time zone. If the instance is a local clock time, it is first set to the local time zone, and then converted to zone. If the instance is a date-only value, a date-only value in zone is returned, with the date unchanged. name="zone" time zone to convert to
UtcOffset ( ) : int Returns the UTC offset associated with the date/time. The UTC offset is the number of seconds to add to UTC to get the local time.
operator ( ) : bool

Protected Methods

Method Description
CreateProxy ( ) : void
KDateTime ( Type dummy ) : System

Private Methods

Method Description
KDateTime ( ) : System

Method Details

AddDays() public method

Returns a date/time days days later than the stored date/time. The result is expressed using the same time specification as the original instance. Note that if the instance is a local clock time (type ClockTime), any daylight savings changes or time zone changes during the period may render the result inaccurate.
public AddDays ( int days ) : KDateTime
days int
return KDateTime

AddMSecs() public method

Returns a date/time msecs milliseconds later than the stored date/time. Except when the instance is a local clock time (type ClockTime), the calculation is done in UTC to ensure that the result takes proper account of clock changes (e.g. daylight savings) in the time zone. The result is expressed using the same time specification as the original instance. Note that if the instance is a local clock time (type ClockTime), any daylight savings changes or time zone changes during the period will render the result inaccurate. If the instance is date-only, msecs is rounded down to a whole number of days and that value is added to the date to find the result.
public AddMSecs ( long msecs ) : KDateTime
msecs long
return KDateTime

AddMonths() public method

Returns a date/time months months later than the stored date/time. The result is expressed using the same time specification as the original instance. Note that if the instance is a local clock time (type ClockTime), any daylight savings changes or time zone changes during the period may render the result inaccurate.
public AddMonths ( int months ) : KDateTime
months int
return KDateTime

AddSecs() public method

Returns a date/time secs seconds later than the stored date/time. Except when the instance is a local clock time (type ClockTime), the calculation is done in UTC to ensure that the result takes proper account of clock changes (e.g. daylight savings) in the time zone. The result is expressed using the same time specification as the original instance. Note that if the instance is a local clock time (type ClockTime), any daylight savings changes or time zone changes during the period will render the result inaccurate. If the instance is date-only, secs is rounded down to a whole number of days and that value is added to the date to find the result.
public AddSecs ( long secs ) : KDateTime
secs long
return KDateTime

AddYears() public method

Returns a date/time years years later than the stored date/time. The result is expressed using the same time specification as the original instance. Note that if the instance is a local clock time (type ClockTime), any daylight savings changes or time zone changes during the period may render the result inaccurate.
public AddYears ( int years ) : KDateTime
years int
return KDateTime

Compare() public method

Compare this instance with another to determine whether they are simultaneous, earlier or later, and in the case of date-only values, whether they overlap (i.e. partly coincide but are not wholly simultaneous). The comparison takes time zones into account: if the two instances have different time zones, they are first converted to UTC before comparing. If both instances are date/time values, this instance is considered to be either simultaneous, earlier or later, and does not overlap. If one instance is date-only and the other is a date/time, this instance is either strictly earlier, strictly later, or overlaps. If both instance are date-only, they are considered simultaneous if both their start of day and end of day times are simultaneous with each other. (Both start and end of day times need to be considered in case a daylight savings change occurs during that day.) Otherwise, this instance can be strictly earlier, earlier but overlapping, later but overlapping, or strictly later. Note that if either instance is a local clock time (type ClockTime), the result cannot be guaranteed to be correct, since by definition they contain no information about time zones or daylight savings changes.
public Compare ( KDateTime other ) : KDateTime.Comparison
other KDateTime
return KDateTime.Comparison

CreateProxy() protected method

protected CreateProxy ( ) : void
return void

CurrentDateTime() public static method

Returns the current date and time, as reported by the system clock, expressed in a given time specification. name="spec" time specification
public static CurrentDateTime ( KDateTime spec ) : KDateTime
spec KDateTime
return KDateTime

CurrentLocalDateTime() public static method

Returns the current date and time, as reported by the system clock, expressed in the local system time zone.
public static CurrentLocalDateTime ( ) : KDateTime
return KDateTime

CurrentUtcDateTime() public static method

Returns the current date and time, as reported by the system clock, expressed in UTC.
public static CurrentUtcDateTime ( ) : KDateTime
return KDateTime

Date() public method

Returns the date part of the date/time. The value returned should be interpreted in terms of the instance's time zone or UTC offset.
public Date ( ) : QDate
return QDate

DateTime() public method

Returns the date/time component of the instance, ignoring the time zone. The value returned should be interpreted in terms of the instance's time zone or UTC offset. The returned value's timeSpec() value will be Qt.UTC if the instance is a UTC time, else Qt.LocalTime. If the instance is date-only, the time value is set to 00:00:00.
public DateTime ( ) : Qyoto.QDateTime
return Qyoto.QDateTime

DaysTo() public method

Calculates the number of days from this date/time to the other date/time. In calculating the result, other is first converted to this instance's time zone. The number of days difference is then calculated ignoring the time parts of the two date/times. For example, if this date/time was 13:00 on 1 January 2000, and other was 02:00 on 2 January 2000, the result would be 1. Note that if either instance is a local clock time (type ClockTime), the result cannot be guaranteed to be accurate, since by definition they contain no information about time zones or daylight savings changes. If one instance is date-only and the other is date-time, the date-time value is first converted to the same time specification as the date-only value, and the result is the difference in days between the resultant date and the date-only date. If both instances are date-only, the calculation ignores time zones. name="other" other date/time
public DaysTo ( KDateTime other ) : int
other KDateTime
return int

Detach() public method

Check whether this date/time is earlier than another. The comparison takes time zones into account: if the two instances have different time zones, they are first converted to UTC before comparing. Note that if either instance is a local clock time (type ClockTime), the result cannot be guaranteed to be correct, since by definition they contain no information about time zones or daylight savings changes. If one or both instances are date-only, the comparison returns true if this date/time or day, falls wholly before the other date/time or day. To achieve this, the time used in the comparison is the end of day (if this instance is date-only) or the start of day (if the other instance is date-only). Create a separate copy of this instance's data if it is implicitly shared with another instance. You would normally only call this if you want different copies of the same date/time value to cache conversions to different time zones. Because only the last conversion to another time zone is cached, and the cached value is implicitly shared, judicious use of detach() could improve efficiency when handling several time zones. But take care: if used inappropriately, it will reduce efficiency!
public Detach ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

Equals() public method

Check whether this date/time is simultaneous with another. The comparison takes time zones into account: if the two instances have different time zones, they are first converted to UTC before comparing. Note that if either instance is a local clock time (type ClockTime), the result cannot be guaranteed to be correct, since by definition they contain no information about time zones or daylight savings changes. If both instances are date-only, they are considered simultaneous if both their start of day and end of day times are simultaneous with each other. (Both start and end of day times need to be considered in case a daylight saving change occurs during that day.)
public Equals ( object o ) : bool
o object
return bool

FromString() public static method

public static FromString ( string arg1 ) : KDateTime
arg1 string
return KDateTime

FromString() public static method

public static FromString ( string arg1, KDateTime format ) : KDateTime
arg1 string
format KDateTime
return KDateTime

FromString() public static method

Returns the KDateTime represented by string, using the format given. This method is the inverse of , except that it can only return a time specification of UTC, OffsetFromUTC or ClockTime. An actual named time zone cannot be returned since an offset from UTC only partially specifies a time zone. The time specification of the result is determined by the UTC offset present in the string: - if the UTC offset is zero the result is type UTC. - if the UTC offset is non-zero, the result is type OffsetFromUTC. - if there is no UTC offset, the result is by default type ClockTime. You can use setFromStringDefault() to change this default. If no time is found in string, a date-only value is returned, except when the specified format does not permit the time to be omitted, in which case an error is returned. An error is therefore returned for ISODate when string includes a time zone specification, and for RFCDate in all cases. For RFC format strings, you should normally set format to RFCDate. Only set it to RFCDateDay if you want to return an error when the day of the week is omitted. For format = ISODate or RFCDate[Day], if an invalid KDateTime is returned, you can check why format was considered invalid by use of outOfRange(). If that method returns true, it indicates that format was in fact valid, but the date lies outside the range which can be represented by QDate. name="string" string to convert name="format" format code. LocalDate cannot be used here. name="negZero" if non-null, the value is set to true if a UTC offset of '-0000' is found or, for RFC 2822 format, an unrecognised or invalid time zone abbreviation is found, else false.
public static FromString ( string arg1, KDateTime format, bool &negZero ) : KDateTime
arg1 string
format KDateTime
negZero bool
return KDateTime

FromString() public static method

public static FromString ( string arg1, string format ) : KDateTime
arg1 string
format string
return KDateTime

FromString() public static method

public static FromString ( string arg1, string format, Kimono.KTimeZones zones ) : KDateTime
arg1 string
format string
zones Kimono.KTimeZones
return KDateTime

FromString() public static method

Returns the KDateTime represented by string, using the format given, optionally using a time zone collection zones as the source of time zone definitions. The format codes are basically the same as those for toString(), and are similar but not identical to those used by strftime(3). The format string consists of the same codes as that for toString(). However, some codes which are distinct in toString() have the same function as each other here. Numeric values without a stated number of digits permit, but do not require, leading zeroes. The maximum number of digits consumed by a numeric code is the minimum needed to cover the possible range of the number (e.g. for minutes, the range is 0 - 59, so the maximum number of digits consumed is 2). All non-numeric values are case insensitive. ate - %y year excluding century (0 - 99). Years 0 - 50 return 2000 - 2050, while years 51 - 99 return 1951 - 1999. - %Y full year number (4 digits with optional sign) - %:Y full year number (>= 4 digits with optional sign) - %:m month number (1 - 12) - %m month number, 2 digits (01 - 12) - %b - %B month name in the current locale or, if no match, in English, abbreviated or in full - %:b - %:B month name in English, abbreviated or in full - %e day of the month (1 - 31) - %d day of the month, 2 digits (01 - 31) - %a - %A weekday name in the current locale or, if no match, in English, abbreviated or in full - %:a - %:A weekday name in English, abbreviated or in full ime - %H hour in the 24 hour clock, 2 digits (00 - 23) - %k hour in the 24 hour clock (0 - 23) - %I hour in the 12 hour clock, 2 digits (01 - 12) - %l hour in the 12 hour clock (1 - 12) - %M minute, 2 digits (00 - 59) - %:M minute (0 - 59) - %S seconds, 2 digits (00 - 59) - %s seconds (0 - 59) - %:S optional seconds value (0 - 59) preceded with ':'. If no colon is found in string, no input is consumed and the seconds value is set to zero. - %:s fractional seconds value, preceded with a decimal point (either '.' or the locale's decimal point symbol) - %P - %p "am" or "pm", in the current locale or, if no match, in English. This format is only useful when used with %I or %l. - %:P - %:p "am" or "pm" in English. This format is only useful when used with %I or %l. ime zone - %:u - %z UTC offset of the time zone in hours and optionally minutes, e.g. -02, -0200. - %:z UTC offset of the time zone in hours and minutes, colon separated, e.g. +02:00. - %Z time zone abbreviation, consisting of alphanumeric characters, e.g. UTC, EDT, GMT. - %:Z time zone name, e.g. Europe/London. The name may contain any characters and is delimited by the following character in the format string. It will not work if you follow %:Z with another escape sequence (except %% or %t). ther - %t matches one or more whitespace characters - %% literal '%' character Any other character must have a matching character in string, except that a space will match zero or more whitespace characters in the input string. If any time zone information is present in the string, the function attempts to find a matching time zone in the zones collection. A time zone name (format code %:Z) will provide an unambiguous look up in zones. Any other type of time zone information (an abbreviated time zone code (%Z) or UTC offset (%z, %:z, %:u) is searched for in zones and if only one time zone is found to match, the result is set to that zone. Otherwise: - If more than one match of a UTC offset is found, the action taken is determined by offsetIfAmbiguous: if offsetIfAmbiguous is true, a local time with an offset from UTC (type OffsetFromUTC) will be returned; if false an invalid KDateTime is returned. - If more than one match of a time zone abbreviation is found, the UTC offset for each matching time zone is compared and, if the offsets are the same, a local time with an offset from UTC (type OffsetFromUTC) will be returned provided that offsetIfAmbiguous is true. Otherwise an invalid KDateTime is returned. - If a time zone abbreviation does not match any time zone in zones, or the abbreviation does not apply at the parsed date/time, an invalid KDateTime is returned. - If a time zone name does not match any time zone in zones, an invalid KDateTime is returned. - If the time zone UTC offset does not match any time zone in zones, a local time with an offset from UTC (type OffsetFromUTC) is returned. If format contains more than one time zone or UTC offset code, an error is returned. If no time zone information is present in the string, by default a local clock time (type ClockTime) is returned. You can use setFromStringDefault() to change this default. If no time is found in string, a date-only value is returned. If any inconsistencies are found, i.e. the same item of information appears more than once but with different values, the weekday name does not tally with the date, an invalid KDateTime is returned. If an invalid KDateTime is returned, you can check why format was considered invalid by use of outOfRange(). If that method returns true, it indicates that format was in fact valid, but the date lies outside the range which can be represented by QDate. name="string" string to convert name="format" format string name="zones" time zone collection, or null for none name="offsetIfAmbiguous" specifies what to do if more than one zone matches the UTC offset found in the string. Ignored if zones is null.
public static FromString ( string arg1, string format, Kimono.KTimeZones zones, bool offsetIfAmbiguous ) : KDateTime
arg1 string
format string
zones Kimono.KTimeZones
offsetIfAmbiguous bool
return KDateTime

GetHashCode() public method

public GetHashCode ( ) : int
return int

IsClockTime() public method

Returns whether the date/time is a local clock time.
public IsClockTime ( ) : bool
return bool

IsDateOnly() public method

Returns whether the instance represents a date/time or a date-only value.
public IsDateOnly ( ) : bool
return bool

IsLocalZone() public method

Returns whether the time zone for the date/time is the current local system time zone.
public IsLocalZone ( ) : bool
return bool

IsNull() public method

Returns whether the date/time is null.
public IsNull ( ) : bool
return bool

IsOffsetFromUtc() public method

Returns whether the date/time is a local time at a fixed offset from UTC.
public IsOffsetFromUtc ( ) : bool
return bool

IsSecondOccurrence() public method

Returns whether the date/time is the second occurrence of this time. This is only applicable to a date/time expressed in terms of a time zone (type TimeZone or LocalZone), around the time of change from daylight savings to standard time. When a shift from daylight savings time to standard time occurs, the local times (typically the previous hour) immediately preceding the shift occur twice. For example, if a time shift of 1 hour happens at 03:00, the clock jumps backwards to 02:00, so the local times between 02:00:00 and 02:59:59 occur once before the shift, and again after the shift. For instances which are not of type TimeZone, or when the date/time is not near to a time shift, false is returned.
public IsSecondOccurrence ( ) : bool
return bool

IsUtc() public method

Returns whether the date/time is a UTC time. It is considered to be a UTC time if it either has a UTC time specification (SpecType == UTC), or has a zero offset from UTC (SpecType == OffsetFromUTC with zero UTC offset).
public IsUtc ( ) : bool
return bool

IsValid() public method

Returns whether the date/time is valid.
public IsValid ( ) : bool
return bool

KDateTime() public method

public KDateTime ( KDateTime other ) : System
other KDateTime
return System

KDateTime() public method

public KDateTime ( QDate date ) : System
date QDate
return System

KDateTime() public method

Constructs a date-only value expressed in a given time specification. The time is set to 00:00:00. The instance is initialised according to the time specification type of spec as follows: - UTC : date is stored as UTC. - OffsetFromUTC : date is a local time at the specified offset from UTC. - TimeZone : date is a local time in the specified time zone. - LocalZone : date is a local date in the current system time zone. - ClockTime : time zones are ignored. name="date" date in the time zone indicated by spec name="spec" time specification
public KDateTime ( QDate date, KDateTime spec ) : System
date QDate
spec KDateTime
return System

KDateTime() public method

public KDateTime ( QDate date, Qyoto.QTime time ) : System
date QDate
time Qyoto.QTime
return System

KDateTime() public method

Constructs a date/time expressed as specified by spec. date and time are interpreted and stored according to the value of spec as follows: - UTC : date and time are in UTC. - OffsetFromUTC : date/time is a local time at the specified offset from UTC. - TimeZone : date/time is a local time in the specified time zone. - LocalZone : date and time are local times in the current system time zone. - ClockTime : time zones are ignored. name="date" date in the time zone indicated by spec name="time" time in the time zone indicated by spec name="spec" time specification
public KDateTime ( QDate date, Qyoto.QTime time, KDateTime spec ) : System
date QDate
time Qyoto.QTime
spec KDateTime
return System

KDateTime() public method

Constructs a date/time from a QDateTime. The KDateTime is expressed in either UTC or the local system time zone, according to dt.timeSpec(). name="dt" date and time
public KDateTime ( Qyoto.QDateTime dt ) : System
dt Qyoto.QDateTime
return System

KDateTime() public method

Constructs a date/time expressed in a given time specification. dt is interpreted and stored according to the time specification type of spec as follows: - UTC : dt is stored as a UTC value. If dt.timeSpec() is Qt.LocalTime, dt is first converted from the current system time zone to UTC before storage. - OffsetFromUTC : date/time is stored as a local time at the specified offset from UTC. If dt.timeSpec() is Qt.UTC, the time is adjusted by the UTC offset before storage. If dt.timeSpec() is Qt.LocalTime, it is assumed to be a local time at the specified offset from UTC, and is stored without adjustment. - TimeZone : if dt is specified as a UTC time (i.e. dt.timeSpec() is Qt.UTC), it is first converted to local time in specified time zone before being stored. - LocalZone : dt is stored as a local time in the current system time zone. If dt.timeSpec() is Qt.UTC, dt is first converted to local time before storage. - ClockTime : If dt.timeSpec() is Qt.UTC, dt is first converted to local time in the current system time zone before storage. After storage, the time is treated as a simple clock time, ignoring time zones. name="dt" date and time name="spec" time specification
public KDateTime ( Qyoto.QDateTime dt, KDateTime spec ) : System
dt Qyoto.QDateTime
spec KDateTime
return System

KDateTime() protected method

protected KDateTime ( Type dummy ) : System
dummy System.Type
return System

OutOfRange() public method

Checks whether the date/time returned by the last call to fromString() was invalid because an otherwise valid date was outside the range which can be represented by QDate. This status occurs when fromString() read a valid string containing a year earlier than -4712 (4713 BC). On exit from fromString(), if outOfRange() returns true, isValid() will return false.
public OutOfRange ( ) : bool
return bool

SecsTo() public method

Returns the number of seconds from this date/time to the other date/time. Before performing the comparison, the two date/times are converted to UTC to ensure that the result is correct if one of the two date/times has daylight saving time (DST) and the other doesn't. The exception is when both instances are local clock time, in which case no conversion to UTC is done. Note that if either instance is a local clock time (type ClockTime), the result cannot be guaranteed to be accurate, since by definition they contain no information about time zones or daylight savings changes. If one instance is date-only and the other is date-time, the date-time value is first converted to the same time specification as the date-only value, and the result is the difference in days between the resultant date and the date-only date. If both instances are date-only, the result is the difference in days between the two dates, ignoring time zones. name="other" other date/time
public SecsTo ( KDateTime other ) : int
other KDateTime
return int

SecsTo_long() public method

Returns the number of seconds from this date/time to the other date/time. Before performing the comparison, the two date/times are converted to UTC to ensure that the result is correct if one of the two date/times has daylight saving time (DST) and the other doesn't. The exception is when both instances are local clock time, in which case no conversion to UTC is done. Note that if either instance is a local clock time (type ClockTime), the result cannot be guaranteed to be accurate, since by definition they contain no information about time zones or daylight savings changes. If one instance is date-only and the other is date-time, the date-time value is first converted to the same time specification as the date-only value, and the result is the difference in days between the resultant date and the date-only date. If both instances are date-only, the result is the difference in days between the two dates, ignoring time zones. name="other" other date/time
public SecsTo_long ( KDateTime other ) : long
other KDateTime
return long

SetDate() public method

Sets the date part of the date/time. name="date" new date value
public SetDate ( QDate date ) : void
date QDate
return void

SetDateOnly() public method

Sets the instance either to being a date and time value, or a date-only value. If its status is changed to date-only, its time is set to 00:00:00. name="dateOnly" true to set to date-only, false to set to date and time.
public SetDateOnly ( bool dateOnly ) : void
dateOnly bool
return void

SetDateTime() public method

Sets the date/time part of the instance, leaving the time specification unaffected. If dt is a local time (
 dt.timeSpec() == Qt.LocalTime 
) and the instance is UTC, dt is first converted from the current system time zone to UTC before being stored. If the instance was date-only, it is changed to being a date and time value. name="dt" date and time
public SetDateTime ( Qyoto.QDateTime dt ) : void
dt Qyoto.QDateTime
return void

SetFromStringDefault() public static method

Sets the default time specification for use by fromString() when no time zone or UTC offset is found in the string being parsed, or when "-0000" is found in an RFC 2822 string. By default, fromString() returns a local clock time (type ClockTime) when no definite zone or UTC offset is found. You can use this method to make it return the local time zone, UTC, or whatever you wish. name="spec" the new default time specification
public static SetFromStringDefault ( KDateTime spec ) : void
spec KDateTime
return void

SetSecondOccurrence() public method

Sets whether the date/time is the second occurrence of this time. This is only applicable to a date/time expressed in terms of a time zone (type TimeZone or LocalZone), around the time of change from daylight savings to standard time. When a shift from daylight savings time to standard time occurs, the local times (typically the previous hour) immediately preceding the shift occur twice. For example, if a time shift of 1 hour happens at 03:00, the clock jumps backwards to 02:00, so the local times between 02:00:00 and 02:59:59 occur once before the shift, and again after the shift. For instances which are not of type TimeZone, or when the date/time is not near to a time shift, calling this method has no effect. Note that most other setting methods clear the second occurrence indicator, so if you want to retain its setting, you must call setSecondOccurrence() again after changing the instance's value. name="second" true to set as the second occurrence, false to set as the first occurrence
public SetSecondOccurrence ( bool second ) : void
second bool
return void

SetTime() public method

Sets the time part of the date/time. If the instance was date-only, it is changed to being a date and time value. name="time" new time value
public SetTime ( Qyoto.QTime time ) : void
time Qyoto.QTime
return void

SetTimeSpec() public method

Changes the time specification of the instance. Any previous time zone is forgotten. The stored date/time component of the instance is left unchanged (except that its UTC/local time setting is set to correspond with spec). Usually this method will change the absolute time which this instance represents. name="spec" new time specification
public SetTimeSpec ( KDateTime spec ) : void
spec KDateTime
return void

SetTime_t() public method

Sets the time to a UTC time, specified as seconds since 00:00:00 UTC 1st January 1970 (as returned by time(2)). name="seconds" number of seconds since 00:00:00 UTC 1st January 1970
public SetTime_t ( long seconds ) : void
seconds long
return void

Time() public method

Returns the time part of the date/time. The value returned should be interpreted in terms of the instance's time zone or UTC offset. If the instance is date-only, the time returned is 00:00:00.
public Time ( ) : Qyoto.QTime
return Qyoto.QTime

TimeSpec() public method

Returns the time specification of the date/time, i.e. whether it is UTC, what time zone it is, etc.
public TimeSpec ( ) : KDateTime.Spec
return KDateTime.Spec

TimeType() public method

Returns the time specification type of the date/time, i.e. whether it is UTC, has a time zone, etc. If the type is the local time zone, TimeZone is returned; use isLocalZone() to check for the local time zone.
public TimeType ( ) : KDateTime.SpecType
return KDateTime.SpecType

TimeZone() public method

Returns the time zone for the date/time. If the date/time is specified as a UTC time, a UTC time zone is always returned.
public TimeZone ( ) : KTimeZone
return KTimeZone

ToClockTime() public method

Returns the time converted to the local clock time. The time is first converted to the local system time zone before setting its type to ClockTime, i.e. no associated time zone. If the instance is a date-only value, a date-only clock time value is returned, with the date unchanged.
public ToClockTime ( ) : KDateTime
return KDateTime

ToLocalZone() public method

Returns the time converted to the current local system time zone. If the instance is a date-only value, a date-only local time zone value is returned, with the date unchanged.
public ToLocalZone ( ) : KDateTime
return KDateTime

ToOffsetFromUtc() public method

Returns the time expressed as an offset from UTC, using the UTC offset associated with this instance's date/time. The date and time components are unchanged. For example, 14:15 on 12 Jan 2001, US Eastern time zone would return a KDateTime value of 14:15 on 12 Jan 2001 with a UTC offset of -18000 seconds (i.e. -5 hours). If the instance is a local clock time, the offset is set to that of the local time zone. If the instance is a date-only value, the offset is set to that at the start of the day.
public ToOffsetFromUtc ( ) : KDateTime
return KDateTime

ToOffsetFromUtc() public method

Returns the time expressed as a specified offset from UTC. If the instance is a local clock time, it is first set to the local time zone, and then converted to the UTC offset. If the instance is a date-only value, a date-only clock time value is returned, with the date unchanged. name="utcOffset" number of seconds to add to UTC to get the local time.
public ToOffsetFromUtc ( int utcOffset ) : KDateTime
utcOffset int
return KDateTime

ToString() public method

public ToString ( ) : string
return string

ToString() public method

Returns the date/time as a string, formatted according to the format parameter, with the UTC offset appended. Note that if the instance has a time specification of ClockTime, the UTC offset in the result will be blank, except for RFC 2822 format in which it will be the offset for the local system time zone. If the instance is date-only, the time will when format permits be omitted from the output string. This applies to format = QtTextDate or LocalDate. It also applies to format = ISODate when the instance has a time specification of ClockTime. For all other cases, a time of 00:00:00 will be output. For RFC 2822 format, set format to RFCDateDay to include the day of the week, or to RFCDate to omit it. name="format" format for output string
public ToString ( KDateTime format ) : string
format KDateTime
return string

ToString() public method

Returns the date/time as a string. The format parameter determines the format of the result string. The format codes used for the date and time components follow those used elsewhere in KDE, and are similar but not identical to those used by strftime(3). Conversion specifiers are introduced by a '%' character, and are replaced in format as follows: ate - %y 2-digit year excluding century (00 - 99). Conversion is undefined if year < 0. - %Y full year number - %:m month number, without leading zero (1 - 12) - %m month number, 2 digits (01 - 12) - %b abbreviated month name in current locale - %B full month name in current locale - %:b abbreviated month name in English (Jan, Feb, ...) - %:B full month name in English - %e day of the month (1 - 31) - %d day of the month, 2 digits (01 - 31) - %a abbreviated weekday name in current locale - %A full weekday name in current locale - %:a abbreviated weekday name in English (Mon, Tue, ...) - %:A full weekday name in English ime - %H hour in the 24 hour clock, 2 digits (00 - 23) - %k hour in the 24 hour clock, without leading zero (0 - 23) - %I hour in the 12 hour clock, 2 digits (01 - 12) - %l hour in the 12 hour clock, without leading zero (1 - 12) - %M minute, 2 digits (00 - 59) - %S seconds (00 - 59) - %:S seconds preceded with ':', but omitted if seconds value is zero - %:s milliseconds, 3 digits (000 - 999) - %P "am" or "pm" in the current locale, or if undefined there, in English - %p "AM" or "PM" in the current locale, or if undefined there, in English - %:P "am" or "pm" - %:p "AM" or "PM" ime zone - %:u UTC offset of the time zone in hours, e.g. -02. If the offset is not a whole number of hours, the output is the same as for '%U'. - %z UTC offset of the time zone in hours and minutes, e.g. -0200. - %:z UTC offset of the time zone in hours and minutes, e.g. +02:00. - %Z time zone abbreviation, e.g. UTC, EDT, GMT. This is not guaranteed to be unique among different time zones. If not applicable (i.e. if the instance is type OffsetFromUTC), the UTC offset is substituted. - %:Z time zone name, e.g. Europe/London. This is system dependent. If not applicable (i.e. if the instance is type OffsetFromUTC), the UTC offset is substituted. ther - %% literal '%' character Note that if the instance has a time specification of ClockTime, the time zone or UTC offset in the result will be blank. If you want to use the current locale's date format, you should call KLocale.FormatDate() to format the date part of the KDateTime. name="format" format for the string
public ToString ( string format ) : string
format string
return string

ToTimeSpec() public method

Returns the time converted to a new time specification. If the instance is a local clock time, it is first set to the local time zone, and then converted to the spec time specification. If the instance is a date-only value, a date-only value is returned, with the date unchanged. name="spec" new time specification
public ToTimeSpec ( KDateTime spec ) : KDateTime
spec KDateTime
return KDateTime

ToTime_t() public method

Converts the time to a UTC time, measured in seconds since 00:00:00 UTC 1st January 1970 (as returned by time(2)).
public ToTime_t ( ) : uint
return uint

ToUtc() public method

Returns the time converted to UTC. The converted time has a UTC offset of zero. If the instance is a local clock time, it is first set to the local time zone, and then converted to UTC. If the instance is a date-only value, a date-only UTC value is returned, with the date unchanged.
public ToUtc ( ) : KDateTime
return KDateTime

ToZone() public method

Returns the time converted to a specified time zone. If the instance is a local clock time, it is first set to the local time zone, and then converted to zone. If the instance is a date-only value, a date-only value in zone is returned, with the date unchanged. name="zone" time zone to convert to
public ToZone ( KTimeZone zone ) : KDateTime
zone KTimeZone
return KDateTime

UtcOffset() public method

Returns the UTC offset associated with the date/time. The UTC offset is the number of seconds to add to UTC to get the local time.
public UtcOffset ( ) : int
return int

operator() public static method

public static operator ( ) : bool
return bool

Property Details

interceptor protected_oe property

protected SmokeInvocation,Qyoto interceptor
return Qyoto.SmokeInvocation