ArcObjects Library Reference (System)  

ITime Interface

Provides access to members that control the Time.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The ITime interface is used to access a scalar time value.  There is no associated temporal reference, so there is no time zone or daylight savings time associated with the value.  The ITime interface can be used to do simple conversions, such as setting a year, month and day, then getting querying for a Julian Day number.  The ITime interface supports values with nanosecond accuracy.  In general, setting individual values such as the year, month, and day can be problematic.  for example, if the Month is set to 2 (February) when the day already has the value 31, this will cause an error because there is no February 31st.  It would be better to set the month and day at the same time.

Members

Description
Method Compare Compares this time to the other time. Returns -1 if this time's value is less, 1 if greater, and 0 otherwise.
Read/write property Day The time's gregorian day.
Read/write property Hour The time's hour.
Read/write property Minute The time's minute.
Read/write property Month The time's gregorian month.
Read/write property Nanoseconds The time's nanoseconds.
Method QueryDayFraction The time's time portion as a day fraction. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.
Method QueryGregorianTime Obtains the time as a gregorian date and time.
Method QueryIntegerTime Obtains the time as an integer time.
Method QueryJulianDayNumber The Time's date portion as a julian (Julius Scaliger) day number. Corresponds to the Year, Month, and Day properties.
Method QueryNanosecondsSinceMidnight The time's time portion as the number of nanoseconds elapsed since midnight. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.
Method QueryOleTime Obtains the time as an OLE automation date object.
Method QueryTicks Obtains the time as the number of ticks since January 1, 0001 AD (Anno Domini).
Method QueryTimeString Obtains the time as a string, based on the given time string format.
Method QueryTimeStringCurrentLocale Obtains the time as a string, based on the current locale.
Method QueryTimeStringCustom Obtains the time as a string, based on the given custom time string format, and locale properties.
Method QueryXMLTimeString Obtains the time as an XML time string.
Read/write property Second The time's second.
Method SetDayFraction The time's time portion as a day fraction. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.
Method SetFromCurrentLocalTime Writes the time to the current date and time on this machine, expressed as the local time.
Method SetFromCurrentUtcTime Writes the time to the current date and time on this machine, expressed as the Coordinated Universal Time (UTC).
Method SetFromGregorianTime Obtains the time from a given gregorian date and time value.
Method SetFromIntegerTime Writes the time from an integer time.
Method SetFromObject Writes the time from a variant object.
Method SetFromOleTime Writes the time from an OLE automation date object.
Method SetFromTicks Writes the time from a given number of ticks since January 1, 0001 AD (Anno Domini) value.
Method SetFromTimeString Writes the time from a string, based on the given time string format.
Method SetFromTimeStringCurrentLocale Obtains the time from a string, based on the current locale.
Method SetFromTimeStringCustom Writes the time from a string, based on the given custom time string formats, and locale properties.
Method SetFromXMLTimeString Writes the time from an XML time string.
Method SetJulianDayNumber The Time's date portion as a julian (Julius Scaliger) day number. Corresponds to the Year, Month, and Day properties.
Method SetNanosecondsSinceMidnight The time's time portion as the number of nanoseconds elapsed since midnight. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.
Method SnapToEndOfMonth Adjust the day value, to the last day in the current month and year.
Method SubtractTime Subtracts a given time, and returns the time duration result.
Method ToLocal Converts the time from Coordinated Universal Time (UTC) value to local (to this machine) time.
Method ToUTC Converts the time from local (to this machine) time value to Coordinated Universal Time (UTC).
Read/write property Year The time's gregorian year.

CoClasses that implement ITime

CoClasses and Classes Description
Time An object that represents a date and time value.