com.esri.arcgis.system
Interface ITime

All Superinterfaces:
Serializable
All Known Subinterfaces:
ITime2
All Known Implementing Classes:
Time

public interface ITime
extends Serializable

Provides access to members that control the Time.

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.

Product Availability

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


Method Summary
 int compare(ITime otherTime)
          Compares this time to the other time.
 short getDay()
          The time's gregorian day.
 short getHour()
          The time's hour.
 short getMinute()
          The time's minute.
 short getMonth()
          The time's gregorian month.
 int getNanoseconds()
          The time's nanoseconds.
 short getSecond()
          The time's second.
 short getYear()
          The time's gregorian year.
 double queryDayFraction()
          The time's time portion as a day fraction.
 _WKSDateTime queryGregorianTime()
          Obtains the time as a gregorian date and time.
 long queryIntegerTime(int integerTimeFormat)
          Obtains the time as an integer time.
 int queryJulianDayNumber()
          The Time's date portion as a julian (Julius Scaliger) day number.
 long queryNanosecondsSinceMidnight()
          The time's time portion as the number of nanoseconds elapsed since midnight.
 Date queryOleTime()
          Obtains the time as an OLE automation date object.
 long queryTicks()
          Obtains the time as the number of ticks since January 1, 0001 AD (Anno Domini).
 String queryTimeString(int timeStringFormat)
          Obtains the time as a string, based on the given time string format.
 String queryTimeStringCurrentLocale(int timeLocaleFormat)
          Obtains the time as a string, based on the current locale.
 String queryTimeStringCustom(String timeStringFormat, int localeID, String amSymbol, String pmSymbol)
          Obtains the time as a string, based on the given custom time string format, and locale properties.
 String queryXMLTimeString(ITimeReference timeReference)
          Obtains the time as an XML time string.
 void setDay(short day)
          The time's gregorian day.
 void setDayFraction(double dayFraction)
          The time's time portion as a day fraction.
 void setFromCurrentLocalTime()
          Writes the time to the current date and time on this machine, expressed as the local time.
 void setFromCurrentUtcTime()
          Writes the time to the current date and time on this machine, expressed as the Coordinated Universal Time (UTC).
 void setFromGregorianTime(_WKSDateTime gregorianTime)
          Obtains the time from a given gregorian date and time value.
 void setFromIntegerTime(int integerTimeFormat, long integerTime)
          Writes the time from an integer time.
 void setFromObject(Object object)
          Writes the time from a variant object.
 void setFromOleTime(Date oleTime)
          Writes the time from an OLE automation date object.
 void setFromTicks(long ticks)
          Writes the time from a given number of ticks since January 1, 0001 AD (Anno Domini) value.
 void setFromTimeString(int timeStringFormat, String timeString)
          Writes the time from a string, based on the given time string format.
 void setFromTimeStringCurrentLocale(int timeLocaleFormat, String timeString)
          Obtains the time from a string, based on the current locale.
 void setFromTimeStringCustom(String timeStringFormat, int localeID, String amSymbol, String pmSymbol, String timeString)
          Writes the time from a string, based on the given custom time string formats, and locale properties.
 int setFromXMLTimeString(String xmlTimeString)
          Writes the time from an XML time string.
 void setHour(short hour)
          The time's hour.
 void setJulianDayNumber(int julianDayNumber)
          The Time's date portion as a julian (Julius Scaliger) day number.
 void setMinute(short minute)
          The time's minute.
 void setMonth(short month)
          The time's gregorian month.
 void setNanoseconds(int nanoseconds)
          The time's nanoseconds.
 void setNanosecondsSinceMidnight(long nanosecondsSinceMidnight)
          The time's time portion as the number of nanoseconds elapsed since midnight.
 void setSecond(short second)
          The time's second.
 void setYear(short year)
          The time's gregorian year.
 void snapToEndOfMonth()
          Adjust the day value, to the last day in the current month and year.
 ITimeDuration subtractTime(ITime time)
          Subtracts a given time, and returns the time duration result.
 void toLocal()
          Converts the time from Coordinated Universal Time (UTC) value to local (to this machine) time.
 void toUTC()
          Converts the time from local (to this machine) time value to Coordinated Universal Time (UTC).
 

Method Detail

getYear

short getYear()
              throws IOException,
                     AutomationException
The time's gregorian year.

Product Availability

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

Returns:
The year
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setYear

void setYear(short year)
             throws IOException,
                    AutomationException
The time's gregorian year.

Product Availability

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

Parameters:
year - The year (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMonth

short getMonth()
               throws IOException,
                      AutomationException
The time's gregorian month.

Product Availability

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

Returns:
The month
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMonth

void setMonth(short month)
              throws IOException,
                     AutomationException
The time's gregorian month.

Product Availability

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

Parameters:
month - The month (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDay

short getDay()
             throws IOException,
                    AutomationException
The time's gregorian day.

Product Availability

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

Returns:
The day
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDay

void setDay(short day)
            throws IOException,
                   AutomationException
The time's gregorian day.

Product Availability

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

Parameters:
day - The day (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getHour

short getHour()
              throws IOException,
                     AutomationException
The time's hour.

Product Availability

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

Returns:
The hour
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setHour

void setHour(short hour)
             throws IOException,
                    AutomationException
The time's hour.

Product Availability

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

Parameters:
hour - The hour (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMinute

short getMinute()
                throws IOException,
                       AutomationException
The time's minute.

Product Availability

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

Returns:
The minute
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMinute

void setMinute(short minute)
               throws IOException,
                      AutomationException
The time's minute.

Product Availability

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

Parameters:
minute - The minute (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSecond

short getSecond()
                throws IOException,
                       AutomationException
The time's second.

Product Availability

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

Returns:
The second
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSecond

void setSecond(short second)
               throws IOException,
                      AutomationException
The time's second.

Product Availability

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

Parameters:
second - The second (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNanoseconds

int getNanoseconds()
                   throws IOException,
                          AutomationException
The time's nanoseconds.

Product Availability

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

Returns:
The nanoseconds
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setNanoseconds

void setNanoseconds(int nanoseconds)
                    throws IOException,
                           AutomationException
The time's nanoseconds.

Product Availability

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

Parameters:
nanoseconds - The nanoseconds (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryJulianDayNumber

int queryJulianDayNumber()
                         throws IOException,
                                AutomationException
The Time's date portion as a julian (Julius Scaliger) day number. Corresponds to the Year, Month, and Day properties.

Product Availability

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

Returns:
The julianDayNumber
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setJulianDayNumber

void setJulianDayNumber(int julianDayNumber)
                        throws IOException,
                               AutomationException
The Time's date portion as a julian (Julius Scaliger) day number. Corresponds to the Year, Month, and Day properties.

Product Availability

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

Parameters:
julianDayNumber - The julianDayNumber (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryDayFraction

double queryDayFraction()
                        throws IOException,
                               AutomationException
The time's time portion as a day fraction. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.

Product Availability

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

Returns:
The dayFraction
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDayFraction

void setDayFraction(double dayFraction)
                    throws IOException,
                           AutomationException
The time's time portion as a day fraction. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.

Product Availability

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

Parameters:
dayFraction - The dayFraction (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryNanosecondsSinceMidnight

long queryNanosecondsSinceMidnight()
                                   throws IOException,
                                          AutomationException
The time's time portion as the number of nanoseconds elapsed since midnight. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.

Product Availability

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

Returns:
Signed 64-bit int
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setNanosecondsSinceMidnight

void setNanosecondsSinceMidnight(long nanosecondsSinceMidnight)
                                 throws IOException,
                                        AutomationException
The time's time portion as the number of nanoseconds elapsed since midnight. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.

Product Availability

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

Parameters:
nanosecondsSinceMidnight - Signed 64-bit int (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

subtractTime

ITimeDuration subtractTime(ITime time)
                           throws IOException,
                                  AutomationException
Subtracts a given time, and returns the time duration result.

Description

This function subtracts the passed time value from the current time, and returns the difference in the TimeDuration parameter. If the passed time value is before the current time value, then the result will be positive. If the passed time value is after the current time value, then the result will be negative.

Product Availability

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

Parameters:
time - A reference to a com.esri.arcgis.system.ITime (in)
Returns:
A reference to a com.esri.arcgis.system.ITimeDuration
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

snapToEndOfMonth

void snapToEndOfMonth()
                      throws IOException,
                             AutomationException
Adjust the day value, to the last day in the current month and year.

Description

SnapToEndOfMonth changes the current date of the Time object, but not the hours, minutes, or seconds. It changes the date to the last day of the month. If the current month is February, then the resulting date will depend on if the current year is a leap year.

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

toUTC

void toUTC()
           throws IOException,
                  AutomationException
Converts the time from local (to this machine) time value to Coordinated Universal Time (UTC).

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

toLocal

void toLocal()
             throws IOException,
                    AutomationException
Converts the time from Coordinated Universal Time (UTC) value to local (to this machine) time.

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryTimeString

String queryTimeString(int timeStringFormat)
                       throws IOException,
                              AutomationException
Obtains the time as a string, based on the given time string format.

Product Availability

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

Parameters:
timeStringFormat - A com.esri.arcgis.system.esriTimeStringFormat constant (in)
Returns:
The timeString
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromTimeString

void setFromTimeString(int timeStringFormat,
                       String timeString)
                       throws IOException,
                              AutomationException
Writes the time from a string, based on the given time string format.

Product Availability

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

Parameters:
timeStringFormat - A com.esri.arcgis.system.esriTimeStringFormat constant (in)
timeString - The timeString (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryTimeStringCurrentLocale

String queryTimeStringCurrentLocale(int timeLocaleFormat)
                                    throws IOException,
                                           AutomationException
Obtains the time as a string, based on the current locale.

Product Availability

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

Parameters:
timeLocaleFormat - A com.esri.arcgis.system.esriTimeLocaleFormat constant (in)
Returns:
The timeString
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromTimeStringCurrentLocale

void setFromTimeStringCurrentLocale(int timeLocaleFormat,
                                    String timeString)
                                    throws IOException,
                                           AutomationException
Obtains the time from a string, based on the current locale.

Product Availability

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

Parameters:
timeLocaleFormat - A com.esri.arcgis.system.esriTimeLocaleFormat constant (in)
timeString - The timeString (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryTimeStringCustom

String queryTimeStringCustom(String timeStringFormat,
                             int localeID,
                             String amSymbol,
                             String pmSymbol)
                             throws IOException,
                                    AutomationException
Obtains the time as a string, based on the given custom time string format, and locale properties.

Description

This function will provide a time/date string in a format specified by the time format string, date format string, and using the AM/PM designators. The time format string uses the following symbols:

h = hour (12 hour clock)

H = hour (24 hour clock)

m = minute

s = second

t = am/pm designator

hh,mm,ss indicate that there is a leading zero for values less than 10

h,m,s indicate that there is no leading zero

Note that the am/pm designator should not be present when the time is measured using a 24-hour clock

the AM/PM designators will only be used if the time string contains the "t" value

The date format string uses the following symbols:

M = month of the year

d = day of the month

y = year

MM and dd indicate that there is a leading zero when the month/day is less than 10

M and d indicate that there is no leading zero

yy indicates a 2 digit year

yyyy indicates a 4 digit year

Product Availability

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

Parameters:
timeStringFormat - The timeStringFormat (in)
localeID - The localeID (in)
amSymbol - The amSymbol (in)
pmSymbol - The pmSymbol (in)
Returns:
The timeString
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromTimeStringCustom

void setFromTimeStringCustom(String timeStringFormat,
                             int localeID,
                             String amSymbol,
                             String pmSymbol,
                             String timeString)
                             throws IOException,
                                    AutomationException
Writes the time from a string, based on the given custom time string formats, and locale properties.

Description

The passed time string is assumed to be in a format specified by the time format string, date format string, and using the AM/PM designators. The time format string uses the following symbols:

h = hour (12 hour clock)

H = hour (24 hour clock)

m = minute

s = second

t = am/pm designator

hh,mm,ss indicate that there is a leading zero for values less than 10

h,m,s indicate that there is no leading zero

Note that the am/pm designator should not be present when the time is measured using a 24-hour clock

the AM/PM designators will only be used if the time string contains the "t" value

The date format string uses the following symbols:

M = month of the year

d = day of the month

y = year

MM and dd indicate that there is a leading zero when the month/day is less than 10

M and d indicate that there is no leading zero

yy indicates a 2 digit year

yyyy indicates a 4 digit year

Product Availability

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

Parameters:
timeStringFormat - The timeStringFormat (in)
localeID - The localeID (in)
amSymbol - The amSymbol (in)
pmSymbol - The pmSymbol (in)
timeString - The timeString (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryXMLTimeString

String queryXMLTimeString(ITimeReference timeReference)
                          throws IOException,
                                 AutomationException
Obtains the time as an XML time string.

Product Availability

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

Parameters:
timeReference - A reference to a com.esri.arcgis.system.ITimeReference (in)
Returns:
The xmlTimeString
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromXMLTimeString

int setFromXMLTimeString(String xmlTimeString)
                         throws IOException,
                                AutomationException
Writes the time from an XML time string.

Product Availability

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

Parameters:
xmlTimeString - The xmlTimeString (in)
Returns:
The timeZoneBiasFromUTC
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryIntegerTime

long queryIntegerTime(int integerTimeFormat)
                      throws IOException,
                             AutomationException
Obtains the time as an integer time.

Product Availability

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

Parameters:
integerTimeFormat - A com.esri.arcgis.system.esriIntegerTimeFormat constant (in)
Returns:
Signed 64-bit int
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromIntegerTime

void setFromIntegerTime(int integerTimeFormat,
                        long integerTime)
                        throws IOException,
                               AutomationException
Writes the time from an integer time.

Product Availability

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

Parameters:
integerTimeFormat - A com.esri.arcgis.system.esriIntegerTimeFormat constant (in)
integerTime - Signed 64-bit int (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromObject

void setFromObject(Object object)
                   throws IOException,
                          AutomationException
Writes the time from a variant object.

Product Availability

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

Parameters:
object - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryOleTime

Date queryOleTime()
                  throws IOException,
                         AutomationException
Obtains the time as an OLE automation date object.

Product Availability

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

Returns:
The oleTime
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromOleTime

void setFromOleTime(Date oleTime)
                    throws IOException,
                           AutomationException
Writes the time from an OLE automation date object.

Product Availability

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

Parameters:
oleTime - The oleTime (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryGregorianTime

_WKSDateTime queryGregorianTime()
                                throws IOException,
                                       AutomationException
Obtains the time as a gregorian date and time.

Product Availability

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

Returns:
A Structure: com.esri.arcgis.system._WKSDateTime (A com.esri.arcgis.system._WKSDateTime COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromGregorianTime

void setFromGregorianTime(_WKSDateTime gregorianTime)
                          throws IOException,
                                 AutomationException
Obtains the time from a given gregorian date and time value.

Product Availability

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

Parameters:
gregorianTime - A Structure: com.esri.arcgis.system._WKSDateTime (A com.esri.arcgis.system._WKSDateTime COM typedef) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryTicks

long queryTicks()
                throws IOException,
                       AutomationException
Obtains the time as the number of ticks since January 1, 0001 AD (Anno Domini).

Product Availability

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

Returns:
Signed 64-bit int
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromTicks

void setFromTicks(long ticks)
                  throws IOException,
                         AutomationException
Writes the time from a given number of ticks since January 1, 0001 AD (Anno Domini) value.

Product Availability

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

Parameters:
ticks - Signed 64-bit int (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromCurrentLocalTime

void setFromCurrentLocalTime()
                             throws IOException,
                                    AutomationException
Writes the time to the current date and time on this machine, expressed as the local time.

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromCurrentUtcTime

void setFromCurrentUtcTime()
                           throws IOException,
                                  AutomationException
Writes the time to the current date and time on this machine, expressed as the Coordinated Universal Time (UTC).

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

compare

int compare(ITime otherTime)
            throws IOException,
                   AutomationException
Compares this time to the other time. Returns -1 if this time's value is less, 1 if greater, and 0 otherwise.

Product Availability

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

Parameters:
otherTime - A reference to a com.esri.arcgis.system.ITime (in)
Returns:
The result
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.