Inheritance: Object, IDisposable
Ejemplo n.º 1
0
 public static KDateTime FromString(string arg1, KDateTime.TimeFormat format)
 {
     return (KDateTime) staticInterceptor.Invoke("fromString$$", "fromString(const QString&, KDateTime::TimeFormat)", typeof(KDateTime), typeof(string), arg1, typeof(KDateTime.TimeFormat), format);
 }
Ejemplo n.º 2
0
 /// <remarks>
 ///  Returns the current date and time, as reported by the system clock,
 ///  expressed in a given time specification.
 /// <param> name="spec" time specification
 /// </param></remarks>        <return> current date/time
 /// </return>
 ///         <short>    Returns the current date and time, as reported by the system clock,  expressed in a given time specification.</short>
 ///         <see> currentUtcDateTime</see>
 ///         <see> currentLocalDateTime</see>
 public static KDateTime CurrentDateTime(KDateTime.Spec spec)
 {
     return (KDateTime) staticInterceptor.Invoke("currentDateTime#", "currentDateTime(const KDateTime::Spec&)", typeof(KDateTime), typeof(KDateTime.Spec), spec);
 }
Ejemplo n.º 3
0
 /// <remarks>
 ///  Returns the KDateTime represented by <code>string</code>, using the <code>format</code> given.
 ///  This method is the inverse of <see cref="#toString"></see>, 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 <code>UTC.</code>
 ///  - if the UTC offset is non-zero, the result is type <code>OffsetFromUTC.</code>
 ///  - if there is no UTC offset, the result is by default type
 ///    <code>ClockTime.</code> You can use setFromStringDefault() to change this default.
 ///  If no time is found in <code>string</code>, a date-only value is returned, except
 ///  when the specified <code>format</code> does not permit the time to be omitted, in
 ///  which case an error is returned. An error is therefore returned for
 ///  ISODate when <code>string</code> includes a time zone specification, and for
 ///  RFCDate in all cases.
 ///  For RFC format strings, you should normally set <code>format</code> to
 ///  RFCDate. Only set it to RFCDateDay if you want to return an error
 ///  when the day of the week is omitted.
 ///  For <code>format</code> = ISODate or RFCDate[Day], if an invalid KDateTime is
 ///  returned, you can check why <code>format</code> was considered invalid by use of
 ///  outOfRange(). If that method returns true, it indicates that <code>format</code>
 ///  was in fact valid, but the date lies outside the range which can be
 ///  represented by QDate.
 /// <param> name="string" string to convert
 /// </param><param> name="format" format code. LocalDate cannot be used here.
 /// </param><param> 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.
 /// </param></remarks>        <return> KDateTime value, or an invalid KDateTime if either parameter is invalid
 /// </return>
 ///         <short>    Returns the KDateTime represented by <code>string</code>, using the <code>format</code> given.</short>
 ///         <see> setFromStringDefault</see>
 ///         <see> toString</see>
 ///         <see> outOfRange</see>
 public static KDateTime FromString(string arg1, KDateTime.TimeFormat format, ref bool negZero)
 {
     StackItem[] stack = new StackItem[4];
     #if DEBUG
     stack[1].s_class = (IntPtr) DebugGCHandle.Alloc(arg1);
     #else
     stack[1].s_class = (IntPtr) GCHandle.Alloc(arg1);
     #endif
     stack[2].s_int = (int) format;
     stack[3].s_bool = negZero;
     staticInterceptor.Invoke("fromString$$$", "fromString(const QString&, KDateTime::TimeFormat, bool*)", stack);
     #if DEBUG
     DebugGCHandle.Free((GCHandle) stack[1].s_class);
     #else
     ((GCHandle) stack[1].s_class).Free();
     #endif
     negZero = stack[3].s_bool;
     object returnValue = ((GCHandle) stack[0].s_class).Target;
     #if DEBUG
     DebugGCHandle.Free((GCHandle) stack[0].s_class);
     #else
     ((GCHandle) stack[0].s_class).Free();
     #endif
     return (KDateTime) returnValue;
 }
Ejemplo n.º 4
0
 /// <remarks>
 ///  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 <code>spec</code>). Usually this method will change the
 ///  absolute time which this instance represents.
 /// <param> name="spec" new time specification
 /// </param></remarks>        <short>    Changes the time specification of the instance.</short>
 ///         <see> timeSpec</see>
 ///         <see> timeZone</see>
 public void SetTimeSpec(KDateTime.Spec spec)
 {
     interceptor.Invoke("setTimeSpec#", "setTimeSpec(const KDateTime::Spec&)", typeof(void), typeof(KDateTime.Spec), spec);
 }
Ejemplo n.º 5
0
 public KDateTime(KDateTime other)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KDateTime#", "KDateTime(const KDateTime&)", typeof(void), typeof(KDateTime), other);
 }
Ejemplo n.º 6
0
 /// <remarks>
 ///  Calculates the number of days from this date/time to the <code>other</code> date/time.
 ///  In calculating the result, <code>other</code> 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 <code>other</code> was 02:00 on 2 January 2000,
 ///  the result would be 1.
 ///  Note that if either instance is a local clock time (type <code>ClockTime</code>),
 ///  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.
 /// <param> name="other" other date/time
 /// </param></remarks>        <return> number of days difference
 /// </return>
 ///         <short>    Calculates the number of days from this date/time to the <code>other</code> date/time.</short>
 ///         <see> secsTo</see>
 ///         <see> addDays</see>
 public int DaysTo(KDateTime other)
 {
     return (int) interceptor.Invoke("daysTo#", "daysTo(const KDateTime&) const", typeof(int), typeof(KDateTime), other);
 }
Ejemplo n.º 7
0
 public string FormatDateTime(KDateTime dateTime, KLocale.DateFormat format)
 {
     return (string) interceptor.Invoke("formatDateTime#$", "formatDateTime(const KDateTime&, KLocale::DateFormat) const", typeof(string), typeof(KDateTime), dateTime, typeof(KLocale.DateFormat), format);
 }
Ejemplo n.º 8
0
 /// <remarks>
 ///  Copy constructor.
 ///          </remarks>        <short>    Copy constructor.</short>
 public Spec(KDateTime.Spec spec)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("Spec#", "Spec(const KDateTime::Spec&)", typeof(void), typeof(KDateTime.Spec), spec);
 }
Ejemplo n.º 9
0
 /// <remarks>
 ///  Checks whether this instance is equivalent to another.
 ///  The two instances are considered to be equivalent if any of the following
 ///  conditions apply:
 ///  - both instances are type <code>ClockTime.</code>
 ///  - both instances are type <code>OffsetFromUTC</code> and their offsets from UTC are equal.
 ///  - both instances are type <code>TimeZone</code> and their time zones are equal.
 ///  - both instances are UTC. An instance is considered to be UTC if it is
 ///    either type <code>UTC</code>, or is type <code>OffsetFromUTC</code> with a zero UTC offset.
 /// </remarks>        <return> @c true if the two instances are equivalent, @c false otherwise
 /// </return>
 ///         <short>    Checks whether this instance is equivalent to another.</short>
 ///         <see> operator==</see>
 public bool EquivalentTo(KDateTime.Spec other)
 {
     return (bool) interceptor.Invoke("equivalentTo#", "equivalentTo(const KDateTime::Spec&) const", typeof(bool), typeof(KDateTime.Spec), other);
 }
Ejemplo n.º 10
0
 /// <remarks>
 ///  Constructs a time specification.
 /// <param> name="type" time specification type, which should not be <code>TimeZone</code>
 /// </param><param> name="utcOffset" number of seconds to add to UTC to get the local
 ///                   time. Ignored if <code>type</code> is not <code>OffsetFromUTC.</code>
 ///          </param></remarks>        <short>    Constructs a time specification.</short>
 public Spec(KDateTime.SpecType type, int utcOffset)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("Spec$$", "Spec(KDateTime::SpecType, int)", typeof(void), typeof(KDateTime.SpecType), type, typeof(int), utcOffset);
 }
Ejemplo n.º 11
0
 public Spec(KDateTime.SpecType type)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("Spec$", "Spec(KDateTime::SpecType)", typeof(void), typeof(KDateTime.SpecType), type);
 }
Ejemplo n.º 12
0
 /// <remarks>
 ///  Returns the time converted to the time specification of another instance.
 ///  If this instance is a local clock time, it is first set to the local time
 ///  zone, and then converted to the <code>spec</code> time specification.
 ///  If this instance is a date-only value, a date-only value is returned,
 ///  with the date unchanged.
 /// <param> name="dt" instance providing the new time specification
 /// </param></remarks>        <return> converted time
 /// </return>
 ///         <short>    Returns the time converted to the time specification of another instance.</short>
 ///         <see> toLocalZone</see>
 ///         <see> toUtc</see>
 ///         <see> toOffsetFromUtc</see>
 ///         <see> toZone</see>
 ///         <see> KTimeZone.Convert</see>
 public KDateTime ToTimeSpec(KDateTime dt)
 {
     return (KDateTime) interceptor.Invoke("toTimeSpec#", "toTimeSpec(const KDateTime&) const", typeof(KDateTime), typeof(KDateTime), dt);
 }
Ejemplo n.º 13
0
 /// <remarks>
 ///  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 <code>spec</code> time specification.
 ///  If the instance is a date-only value, a date-only value is returned,
 ///  with the date unchanged.
 /// <param> name="spec" new time specification
 /// </param></remarks>        <return> converted time
 /// </return>
 ///         <short>    Returns the time converted to a new time specification.</short>
 ///         <see> toLocalZone</see>
 ///         <see> toUtc</see>
 ///         <see> toOffsetFromUtc</see>
 ///         <see> toZone</see>
 ///         <see> KTimeZone.Convert</see>
 public KDateTime ToTimeSpec(KDateTime.Spec spec)
 {
     return (KDateTime) interceptor.Invoke("toTimeSpec#", "toTimeSpec(const KDateTime::Spec&) const", typeof(KDateTime), typeof(KDateTime.Spec), spec);
 }
Ejemplo n.º 14
0
 /// <remarks>
 ///  Returns the date/time as a string, formatted according to the <code>format</code>
 ///  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 <code>format</code> permits be
 ///  omitted from the output string. This applies to <code>format</code> = QtTextDate
 ///  or LocalDate. It also applies to <code>format</code> = 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 <code>format</code> to RFCDateDay to include the day
 ///  of the week, or to RFCDate to omit it.
 /// <param> name="format" format for output string
 /// </param></remarks>        <return> formatted string
 /// </return>
 ///         <short>    Returns the date/time as a string, formatted according to the <code>format</code>  parameter, with the UTC offset appended.</short>
 ///         <see> fromString</see>
 ///         <see> QDateTime.ToString</see>
 public string ToString(KDateTime.TimeFormat format)
 {
     return (string) interceptor.Invoke("toString$", "toString(KDateTime::TimeFormat) const", typeof(string), typeof(KDateTime.TimeFormat), format);
 }
Ejemplo n.º 15
0
 /// <remarks>
 ///  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 <code>ClockTime</code>)
 ///  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.
 /// <param> name="spec" the new default time specification
 /// </param></remarks>        <short>    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.</short>
 ///         <see> fromString</see>
 public static void SetFromStringDefault(KDateTime.Spec spec)
 {
     staticInterceptor.Invoke("setFromStringDefault#", "setFromStringDefault(const KDateTime::Spec&)", typeof(void), typeof(KDateTime.Spec), spec);
 }
Ejemplo n.º 16
0
 /// <remarks>
 ///  Initialises the time specification.
 /// <param> name="type" the time specification type. Note that <code>TimeZone</code>
 ///                   is invalid here.
 /// </param><param> name="utcOffset" number of seconds to add to UTC to get the local
 ///                   time. Ignored if <code>spec</code> is not <code>OffsetFromUTC.</code>
 /// </param></remarks>        <short>    Initialises the time specification.</short>
 ///         <see> type</see>
 ///         <see> setType(const</see>
 ///         <see> KTimeZone&)</see>
 public void SetType(KDateTime.SpecType type, int utcOffset)
 {
     interceptor.Invoke("setType$$", "setType(KDateTime::SpecType, int)", typeof(void), typeof(KDateTime.SpecType), type, typeof(int), utcOffset);
 }
Ejemplo n.º 17
0
 /// <remarks>
 ///  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 <code>ClockTime</code>),
 ///  the result cannot be guaranteed to be correct, since by definition they
 ///  contain no information about time zones or daylight savings changes.
 /// </remarks>        <return> @c true if the two instances represent the same time, @c false otherwise
 /// </return>
 ///         <short>    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.</short>
 ///         <see> operator==</see>
 ///         <see> operator!=</see>
 ///         <see> operator<</see>
 ///         <see> operator<=</see>
 ///         <see> operator>=</see>
 ///         <see> operator></see>
 public KDateTime.Comparison Compare(KDateTime other)
 {
     return (KDateTime.Comparison) interceptor.Invoke("compare#", "compare(const KDateTime&) const", typeof(KDateTime.Comparison), typeof(KDateTime), other);
 }
Ejemplo n.º 18
0
 public void SetType(KDateTime.SpecType type)
 {
     interceptor.Invoke("setType$", "setType(KDateTime::SpecType)", typeof(void), typeof(KDateTime.SpecType), type);
 }
Ejemplo n.º 19
0
 /// <remarks>
 ///  Returns a string formatted to the current locale's conventions
 ///  regarding both date and time.
 /// <param> name="dateTime" the date and time to be formatted
 /// </param><param> name="format" category of date format to use
 /// </param><param> name="options" additional output options
 /// </param></remarks>        <return> The date and time as a string
 ///    </return>
 ///         <short>    Returns a string formatted to the current locale's conventions  regarding both date and time.</short>
 public string FormatDateTime(KDateTime dateTime, KLocale.DateFormat format, uint options)
 {
     return (string) interceptor.Invoke("formatDateTime#$$", "formatDateTime(const KDateTime&, KLocale::DateFormat, KLocale::DateTimeFormatOptions) const", typeof(string), typeof(KDateTime), dateTime, typeof(KLocale.DateFormat), format, typeof(uint), options);
 }
Ejemplo n.º 20
0
 /// <remarks>
 ///  Constructs a date/time expressed in a given time specification.
 ///  <code>dt</code> is interpreted and stored according to the time specification type
 ///  of <code>spec</code> as follows:
 ///  - <code>UTC</code>           : <code>dt</code> is stored as a UTC value. If
 ///                       <code>dt.timeSpec</code>() is <code>Qt</code>.LocalTime, <code>dt</code> is first
 ///                       converted from the current system time zone to UTC
 ///                       before storage.
 ///  - <code>OffsetFromUTC</code> : date/time is stored as a local time at the specified
 ///                       offset from UTC. If <code>dt.timeSpec</code>() is <code>Qt</code>.UTC,
 ///                       the time is adjusted by the UTC offset before
 ///                       storage. If <code>dt.timeSpec</code>() is <code>Qt</code>.LocalTime,
 ///                       it is assumed to be a local time at the specified
 ///                       offset from UTC, and is stored without adjustment.
 ///  - <code>TimeZone</code>      : if <code>dt</code> is specified as a UTC time (i.e. <code>dt.timeSpec</code>()
 ///                       is <code>Qt</code>.UTC), it is first converted to local time in
 ///                       specified time zone before being stored.
 ///  - <code>LocalZone</code>     : <code>dt</code> is stored as a local time in the current system
 ///                       time zone. If <code>dt.timeSpec</code>() is <code>Qt</code>.UTC, <code>dt</code> is
 ///                       first converted to local time before storage.
 ///  - <code>ClockTime</code>     : If <code>dt.timeSpec</code>() is <code>Qt</code>.UTC, <code>dt</code> 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.
 /// <param> name="dt" date and time
 /// </param><param> name="spec" time specification
 ///      </param></remarks>        <short>    Constructs a date/time expressed in a given time specification.</short>
 public KDateTime(QDateTime dt, KDateTime.Spec spec)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KDateTime##", "KDateTime(const QDateTime&, const KDateTime::Spec&)", typeof(void), typeof(QDateTime), dt, typeof(KDateTime.Spec), spec);
 }
Ejemplo n.º 21
0
 public string FormatDateTime(KDateTime dateTime)
 {
     return (string) interceptor.Invoke("formatDateTime#", "formatDateTime(const KDateTime&) const", typeof(string), typeof(KDateTime), dateTime);
 }
Ejemplo n.º 22
0
 /// <remarks>
 ///  Returns the number of seconds from this date/time to the <code>other</code> 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 <code>ClockTime</code>),
 ///  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.
 /// <param> name="other" other date/time
 /// </param></remarks>        <return> number of seconds difference
 /// </return>
 ///         <short>    Returns the number of seconds from this date/time to the <code>other</code> date/time.</short>
 ///         <see> secsTo</see>
 ///         <see> addSecs</see>
 ///         <see> daysTo</see>
 public long SecsTo_long(KDateTime other)
 {
     return (long) interceptor.Invoke("secsTo_long#", "secsTo_long(const KDateTime&) const", typeof(long), typeof(KDateTime), other);
 }