| Oracle® Data Provider for .NET Developer's Guide Release 9.2.0.4 Part Number B10961-01 |
|
Oracle.DataAccess.Types Namespace (ODP.NET Types), 8 of 19
The OracleTimeStamp structure represents the Oracle TIMESTAMP datatype to be stored in or retrieved from a database. Each OracleTimeStamp stores the following information: year, month, day, hour, minute, second, and nanosecond.
Object
ValueType
OracleTimeStamp
// C# public struct OracleTimeStamp : IComparable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C# // Illustrates usage of OracleTimeStamp OracleTimeStamp tsCurrent1 = OracleTimeStamp.GetSysDate(); OracleTimeStamp tsCurrent2 = DateTime.Now; // Calculate the difference between tsCurrent1 and tsCurrent2 OracleIntervalDS idsDiff = tsCurrent2.GetDaysBetween(tsCurrent1); // Calculate the difference using AddNanoseconds() int nanoDiff = 0; while (tsCurrent2 > tsCurrent1) { nanoDiff += 10; tsCurrent1 = tsCurrent1.AddNanoseconds(10); } Console.WriteLine("idsDiff.Nanoseconds = " + idsDiff.Nanoseconds); Console.WriteLine("nanoDiff = " + nanoDiff);
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
OracleTimeStamp members are listed in the following tables:
OracleTimeStamp constructors are listed in Table 5-87
| Constructor | Description |
|---|---|
|
Instantiates a new instance of OracleTimeStamp structure (Overloaded) |
The OracleTimeStamp static fields are listed in Table 5-88.
The OracleTimeStamp static methods are listed in Table 5-89.
The OracleTimeStamp static operators are listed in Table 5-90.
The OracleTimeStamp static type conversions are listed in Table 5-91.
The OracleTimeStamp properties are listed in Table 5-92.
The OracleTimeStamp methods are listed in Table 5-93.
The OracleTimeStamp constructors create new instances of the OracleTimeStamp structure.
This constructor creates a new instance of the OracleTimeStamp structure and sets its value for date and time using the supplied DateTime value.
This constructor creates a new instance of the OracleTimeStamp structure and sets its value using the supplied string.
This constructor creates a new instance of the OracleTimeStamp structure and sets its value for date using year, month, and day.
This constructor creates a new instance of the OracleTimeStamp structure and sets its value for date and time using year, month, day, hour, minute, and second.
This constructor creates a new instance of the OracleTimeStamp structure and sets its value for date and time using year, month, day, hour, minute, second, and millisecond.
This constructor creates a new instance of the OracleTimeStamp structure and sets its value for date and time using year, month, day, hour, minute, second, and nanosecond.
This constructor creates a new instance of the OracleTimeStamp structure and sets its value to the provided byte array, which is in the internal Oracle TIMESTAMP format.
This constructor creates a new instance of the OracleTimeStamp structure and sets its value for date and time using the supplied DateTime value.
// C# public OracleTimeStamp (DateTime dt);
ArgumentException - The dt parameter cannot be used to construct a valid OracleTimeStamp.
This constructor creates a new instance of the OracleTimeStamp structure and sets its value using the supplied string.
// C# public OracleTimeStamp (string tsStr);
ArgumentException - The tsStr value is an invalid string representation of an Oracle TIMESTAMP or the supplied tsStr is not in the timestamp format specified by the OracleGlobalization.TimeStampFormat property of the thread, which represents Oracle's NLS_TIMESTAMP_FORMAT parameter.
ArgumentNullException - The tsStr value is null.
The names and abbreviations used for months and days are in the language specified by the DateLanguage and Calendar properties of the thread's OracleGlobalization object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_format for the OracleTimeStamp(string) constructor OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStamp from a string using the format specified. OracleTimeStamp ts = new OracleTimeStamp("11-NOV-1999 11:02:33.444 AM"); // Set the nls_timestamp_format for the ToString() method og.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(ts.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM"
|
See Also:
|
This constructor creates a new instance of the OracleTimeStamp structure and sets its value for date using year, month, and day.
// C# public OracleTimeStamp(int year, int month, int day);
year
The year provided. Range of year is (-4712 to 9999).
month
The month provided. Range of month is (1 to 12).
day
The day provided. Range of day is (1 to 31).
ArgumentOutOfRangeException - The argument value for one or more of the parameters is out of the specified range.
ArgumentException - The argument values of the parameters cannot be used to construct a valid OracleTimeStamp (that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStamp structure and sets its value for date and time using year, month, day, hour, minute, and second.
// C# public OracleTimeStamp (int year, int month, int day, int hour, int minute, int second);
year
The year provided. Range of year is (-4712 to 9999).
month
The month provided. Range of month is (1 to 12).
day
The day provided. Range of day is (1 to 31).
hour
The hour provided. Range of hour is (0 to 23).
minute
The minute provided. Range of minute is (0 to 59).
second
The second provided. Range of second is (0 to 59).
ArgumentOutOfRangeException - The argument value for one or more of the parameters is out of the specified range.
ArgumentException - The argument values of the parameters cannot be used to construct a valid OracleTimeStamp (that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStamp structure and sets its value for date and time using year, month, day, hour, minute, second, and millisecond.
// C# public OracleTimeStamp(int year, int month, int day, int hour, int minute, int second, double millisecond);
year
The year provided. Range of year is (-4712 to 9999).
month
The month provided. Range of month is (1 to 12).
day
The day provided. Range of day is (1 to 31).
hour
The hour provided. Range of hour is (0 to 23).
minute
The minute provided. Range of minute is (0 to 59).
second
The second provided. Range of second is (0 to 59).
milliSeconds
The milliseconds provided. Range of millisecond is (0 to 999.999999).
ArgumentOutOfRangeException - The argument value for one or more of the parameters is out of the specified range.
ArgumentException - The argument values of the parameters cannot be used to construct a valid OracleTimeStamp (that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStamp structure and sets its value for date and time using year, month, day, hour, minute, second, and nanosecond.
// C#
public OracleTimeStamp (int year, int month, int day, int hour, int minute, int
second, int nanosecond);
year
The year provided. Range of year is (-4712 to 9999).
month
The month provided. Range of month is (1 to 12).
day
The day provided. Range of day is (1 to 31).
hour
The hour provided. Range of hour is (0 to 23).
minute
The minute provided. Range of minute is (0 to 59).
second
The second provided. Range of second is (0 to 59).
nanosecond
The nanosecond provided. Range of nanosecond is (0 to 999999999).
ArgumentOutOfRangeException - The argument value for one or more of the parameters is out of the specified range.
ArgumentException - The argument values of the parameters cannot be used to construct a valid OracleTimeStamp (that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStamp structure and sets its value to the provided byte array, which is in the internal Oracle TIMESTAMP format.
// C#
public OracleTimeStamp (byte[] bytes);
ArgumentException - bytes is not in an internal Oracle TIMESTAMP format or bytes is not a valid Oracle TIMESTAMP.
ArgumentNullException - bytes is null.
The OracleTimeStamp static fields are listed in Table 5-94.
This static field represents the maximum valid date and time for an OracleTimeStamp structure, which is December 31, 9999 23:59:59.999999999.
// C# public static readonly OraTimestamp MaxValue;
This static field represents the minimum valid date and time for an OracleTimeStamp structure, which is January 1, -4712 0:0:0.
// C# public static readonly OracleTimeStamp MinValue;
This static field represents a null value that can be assigned to an instance of the OracleTimeStamp structure.
// C# public static readonly OracleTimeStamp Null;
The OracleTimeStamp static methods are listed in Table 5-95.
This static method determines if two OracleTimeStamp values are equal.
// C# public static bool Equals(OracleTimeStamp value1, OracleTimeStamp value2);
Returns true if two OracleTimeStamp values are equal; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
This static method determines if the first of two OracleTimeStamp values is greater than the second.
// C# public static bool GreaterThan(OracleTimeStamp value1, OracleTimeStamp value2);
Returns true if the first of two OracleTimeStamp values is greater than the second; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
This static method determines if the first of two OracleTimeStamp values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleTimeStamp value1, OracleTimeStamp value2);
Returns true if the first of two OracleTimeStamp values is greater than or equal to the second; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
This static method determines if the first of two OracleTimeStamp values is less than the second.
// C# public static bool LessThan(OracleTimeStamp value1, OracleTimeStamp value2);
Returns true if the first of two OracleTimeStamp values is less than the second. Returns false otherwise.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
This static method determines if the first of two OracleTimeStamp values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleTimeStamp value1, OracleTimeStamp value2);
Returns true if the first of two OracleTimeStamp values is less than or equal to the second. Returns false otherwise.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
This static method determines if two OracleTimeStamp values are not equal.
// C# public static bool NotEquals(OracleTimeStamp value1, OracleTimeStamp value2);
Returns true if two OracleTimeStamp values are not equal. Returns false otherwise.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
This static method gets an OracleTimeStamp structure that represents the current date and time.
// C# public static OracleTimeStamp GetSysDate();
An OracleTimeStamp structure that represents the current date and time.
This static method gets an OracleTimeStamp structure and sets its value using the supplied string.
// C# public static OracleTimeStamp Parse(string datetime);
An OracleTimeStamp structure.
ArgumentException - The tsStr is an invalid string representation of an Oracle TIMESTAMP or the supplied tsStr is not in the timestamp format specified by the OracleGlobalization.TimeStampFormat property of the thread, which represents Oracle's NLS_TIMESTAMP_FORMAT parameter.
ArgumentNullException - The tsStr value is null.
The names and abbreviations used for months and days are in the language specified by the DateLanguage and Calendar properties of the thread's OracleGlobalization object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_format for the Parse() method OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStamp from a string using the format specified. OracleTimeStamp ts = OracleTimeStamp.Parse("11-NOV-1999 11:02:33.444 AM"); // Set the nls_timestamp_format for the ToString() method og.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(ts.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM"
This static method returns a new instance of an OracleTimeStamp with the specified fractional second precision.
// C# public static OracleTimeStamp SetPrecision(OracleTimeStamp value1, int fracSecPrecision);
value1
The provided OracleTimeStamp object.
fracSecPrecision
The fractional second precision provided. Range of fractional second precision is (0 to 9).
An OracleTimeStamp structure with the specified fractional second precision.
ArgumentOutOfRangeException - fracSecPrecision is out of the specified range.
The value specified in the supplied fracSecPrecision is used to perform a rounding off operation on the supplied OracleTimeStamp value. Depending on this value, 0 or more trailing zeros are displayed in the string returned by ToString().
The OracleTimeStamp with a value of "December 31, 9999 23:59:59.99" results in the string "December 31, 9999 23:59:59.99000" when SetPrecision() is called with the fractional second precision set to 5.
The OracleTimeStamp static operators are listed in Table 5-96.
operator+ adds the supplied object to the OracleTimeStamp and returns a new OracleTimeStamp structure.
This static operator adds the supplied OracleIntervalDS to the OracleTimeStamp and returns a new OracleTimeStamp structure.
This static operator adds the supplied OracleIntervalYM to the supplied OracleTimeStamp and returns a new OracleTimeStamp structure.
This static operator adds the supplied TimeSpan to the supplied OracleTimeStamp and returns a new OracleTimeStamp structure.
This static operator adds the supplied OracleIntervalDS to the OracleTimeStamp and returns a new OracleTimeStamp structure.
// C# public static operator + (OracleTimeStamp value1, OracleIntervalDS value2);
An OracleTimeStamp.
If either parameter has a null value, the returned OracleTimeStamp has a null value.
This static operator adds the supplied OracleIntervalYM to the supplied OracleTimeStamp and returns a new OracleTimeStamp structure.
// C# public static operator + (OracleTimeStamp value1, OracleIntervalYM value2);
An OracleTimeStamp.
If either parameter has a null value, the returned OracleTimeStamp has a null value.
This static operator adds the supplied TimeSpan to the supplied OracleTimeStamp and returns a new OracleTimeStamp structure.
// C# public static operator + (OracleTimeStamp value1, TimeSpan value2);
An OracleTimeStamp.
If the OracleTimeStamp instance has a null value, the returned OracleTimeStamp has a null value.
This static operator determines if two OracleTimeStamp values are equal.
// C# public static bool operator == (OracleTimeStamp value1, OracleTimeStamp value2);
Returns true if they are the same; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
This static operator determines if the first of two OracleTimeStamp values is greater than the second.
// C# public static bool operator > (OracleTimeStamp value1, OracleTimeStamp value2);
Returns true if the first OracleTimeStamp value is greater than the second; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
This static operator determines if the first of two OracleTimeStamp values is greater than or equal to the second.
// C# public static bool operator >= (OracleTimeStamp value1, OracleTimeStamp value2);
Returns true if the first OracleTimeStamp is greater than or equal to the second; otherwise returns false.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
This static operator determines if two OracleTimeStamp values are not equal.
// C# public static bool operator != (OracleTimeStamp value1, OracleTimeStamp value2);
Returns true if two OracleTimeStamp values are not equal; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
This static operator determines if the first of two OracleTimeStamp values is less than the second.
// C# public static bool operator < (OracleTimeStamp value1, OracleTimeStamp value2);
Returns true if the first OracleTimeStamp is less than the second; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
This static operator determines if the first of two OracleTimeStamp values is less than or equal to the second.
// C# public static bool operator <= (OracleTimeStamp value1, OracleTimeStamp value2);
Returns true if the first OracleTimeStamp is less than or equal to the second; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
operator- subtracts the supplied value, from the supplied OracleTimeStamp value, and returns a new OracleTimeStamp structure.
This static operator subtracts the supplied OracleIntervalDS value, from the supplied OracleTimeStamp value, and return a new OracleTimeStamp structure.
This static operator subtracts the supplied OracleIntervalYM value, from the supplied OracleTimeStamp value, and returns a new OracleTimeStamp structure.
This static operator subtracts the supplied TimeSpan value, from the supplied OracleTimeStamp value, and returns a new OracleTimeStamp structure.
This static operator subtracts the supplied OracleIntervalDS value, from the supplied OracleTimeStamp value, and return a new OracleTimeStamp structure.
// C# public static operator - (OracleTimeStamp value1, OracleIntervalDS value2);
An OracleTimeStamp structure.
If either parameter has a null value, the returned OracleTimeStamp has a null value.
This static operator subtracts the supplied OracleIntervalYM value, from the supplied OracleTimeStamp value, and returns a new OracleTimeStamp structure.
// C# public static operator - (OracleTimeStamp value1, OracleIntervalYM value2);
An OracleTimeStamp structure.
If either parameter has a null value, the returned OracleTimeStamp has a null value.
This static operator subtracts the supplied TimeSpan value, from the supplied OracleTimeStamp value, and returns a new OracleTimeStamp structure.
// C# public static operator - (OracleTimeStamp value1, TimeSpan value2);
An OracleTimeStamp structure.
If the OracleTimeStamp instance has a null value, the returned OracleTimeStamp structure has a null value.
The OracleTimeStamp static type conversions are listed in Table 5-97.
explicit operator OracleTimeStamp converts the supplied value to an OracleTimeStamp structure
This static type conversion operator converts an OracleTimeStampLTZ value to an OracleTimeStamp structure.
This static type conversion operator converts an OracleTimeStampTZ value to an OracleTimeStamp structure.
This static type conversion operator converts the supplied string to an OracleTimeStamp structure.
This static type conversion operator converts an OracleTimeStampLTZ value to an OracleTimeStamp structure.
// C# public static explicit operator OracleTimeStamp(OracleTimeStampLTZ value1);
The returned OracleTimeStamp contains the date and time of the OracleTimeStampLTZ structure.
If the OracleTimeStampLTZ structure has a null value, the returned OracleTimeStamp structure also has a null value.
This static type conversion operator converts an OracleTimeStampTZ value to an OracleTimeStamp structure.
// C# public static explicit operator OracleTimeStamp(OracleTimeStampTZ value1);
The returned OracleTimeStamp contains the date and time information from value1, but the time zone information from value1 is truncated.
If the OracleTimeStampTZ structure has a null value, the returned OracleTimeStamp structure also has a null value.
This static type conversion operator converts the supplied string to an OracleTimeStamp structure.
// C# public static explicit operator OracleTimeStamp(string tsStr);
A OracleTimeStamp.
ArgumentException - The tsStr is an invalid string representation of an Oracle TIMESTAMP or the tsStr is not in the timestamp format specified by the thread's OracleGlobalization.TimeStampFormat property, which represents Oracle's NLS_TIMESTAMP_FORMAT parameter.
The names and abbreviations used for months and days are in the language specified by the DateLanguage and Calendar properties of the thread's OracleGlobalization object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_format for the explicit operator // OracleTimeStamp(string) OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStamp from a string using the format specified. OracleTimeStamp ts = new OracleTimeStamp("11-NOV-1999 11:02:33.444 AM"); // Set the nls_timestamp_format for the ToString method og.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(ts.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM"
|
See Also:
|
This static type conversion operator converts a value to an OracleTimeStamp structure.
This static type conversion operator converts an OracleDate value to an OracleTimeStamp structure.
This static type conversion operator converts a DateTime value to an OracleTimeStamp structure.
This static type conversion operator converts an OracleDate value to an OracleTimeStamp structure.
// C# public static implicit operator OracleTimeStamp (OracleDate value1);
An OracleTimeStamp structure that contains the date and time of the OracleDate structure, value1.
If the OracleDate structure has a null value, the returned OracleTimeStamp structure also has a null value.
This static type conversion operator converts a DateTime value to an OracleTimeStamp structure.
// C# public static implicit operator OracleTimeStamp(DateTime value);
An OracleTimeStamp structure.
This static type conversion operator converts an OracleTimeStamp value to a DateTime structure.
// C# public static explicit operator DateTime(OracleTimeStamp value1);
A DateTime containing the date and time in the current instance.
OracleNullValueException - The OracleTimeStamp structure has a null value.
The precision of the OracleTimeStamp can be lost during the conversion.
The OracleTimeStamp properties are listed in Table 5-98.
This property returns an array of bytes that represents an Oracle TIMESTAMP in Oracle internal format.
// C# public byte[] BinData {get;}
A byte array that represents an Oracle TIMESTAMP in an internal format.
OracleNullValueException - The current instance has a null value.
This property specifies the day component of an OracleTimeStamp.
// C# public int Day{get;}
A number that represents the day. Range of Day is (1 to 31).
OracleNullValueException - The current instance has a null value.
This property indicates whether the current instance has a null value.
// C# public bool IsNull{get;}
Returns true if the current instance has a null value; otherwise, returns false.
This property specifies the hour component of an OracleTimeStamp.
// C# public int Hour{get;}
A number that represents the hour. Range of hour is (0 to 23).
OracleNullValueException - The current instance has a null value.
This property gets the millisecond component of an OracleTimeStamp.
// C# public double Millisecond{get;}
A number that represents a millisecond. Range of Millisecond is (0 to 999.999999).
OracleNullValueException - The current instance has a null value.
This property gets the minute component of an OracleTimeStamp.
// C# public int Minute{get;}
A number that represent a minute. Range of Minute is (0 to 59).
OracleNullValueException - The current instance has a null value.
This property gets the month component of an OracleTimeStamp.
// C# public int Month{get;}
A number that represents a month. Range of Month is (1 to 12).
OracleNullValueException - The current instance has a null value.
This property gets the nanosecond component of an OracleTimeStamp.
// C# public int Nanosecond{get;}
A number that represents a nanosecond. Range of Nanosecond is (0 to 999999999).
OracleNullValueException - The current instance has a null value.
This property gets the second component of an OracleTimeStamp.
// C# public int Second{get;}
A number that represents a second. Range of Second is (0 to 59).
OracleNullValueException - The current instance has a null value.
This property specifies the date and time that is stored in the OracleTimeStamp structure.
// C# public DateTime Value{get;}
A DateTime.
OracleNullValueException - The current instance has a null value.
This property gets the year component of an OracleTimeStamp.
// C# public int Year{get;}
A number that represents a year. The range of Year is (-4712 to 9999).
OracleNullValueException - The current instance has a null value.
The OracleTimeStamp methods are listed in Table 5-99.
This method adds the supplied number of days to the current instance.
// C# public OracleTimeStamp AddDays(double days);
An OracleTimeStamp.
ArgumentOutofRangeException - The argument value is out of the specified range.
OracleNullValueException - The current instance has a null value.
This method adds the supplied number of hours to the current instance.
// C# public OracleTimeStamp AddHours(double hours);
An OracleTimeStamp.
ArgumentOutofRangeException - The argument value is out of the specified range.
OracleNullValueException - The current instance has a null value.
This method adds the supplied number of milliseconds to the current instance.
// C# public OracleTimeStamp AddMilliseconds(double milliseconds);
milliseconds
The supplied number of milliseconds. Range is (-8.64 * 1016< milliseconds < 8.64 * 1016).
An OracleTimeStamp.
ArgumentOutofRangeException - The argument value is out of the specified range.
OracleNullValueException - The current instance has a null value.
This method adds the supplied number of minutes to the current instance.
// C# public OracleTimeStamp AddMinutes(double minutes);
minutes
The supplied number of minutes. Range is (-1,440,000,000,000 < minutes < 1,440,000,000,000).
An OracleTimeStamp.
ArgumentOutofRangeException - The argument value is out of the specified range.
OracleNullValueException - The current instance has a null value.
This method adds the supplied number of months to the current instance.
// C# public OracleTimeStamp AddMonths(long months);
An OracleTimeStamp.
ArgumentOutofRangeException - The argument value is out of the specified range.
OracleNullValueException - The current instance has a null value.
This method adds the supplied number of nanoseconds to the current instance.
// C# public OracleTimeStamp AddNanoseconds(long nanoseconds);
An OracleTimeStamp.
OracleNullValueException - The current instance has a null value.
This method adds the supplied number of seconds to the current instance.
// C# public OracleTimeStamp AddSeconds(double seconds);
An OracleTimeStamp.
ArgumentOutofRangeException - The argument value is out of the specified range.
OracleNullValueException - The current instance has a null value.
This method adds the supplied number of years to the current instance.
// C# public OracleTimeStamp AddYears(int years);
An OracleTimeStamp.
ArgumentOutofRangeException - The argument value is out of the specified range.
OracleNullValueException - The current instance has a null value.
This method compares the current OracleTimeStamp instance to an object, and returns an integer that represents their relative values.
// C# public int CompareTo(object obj);
The method returns a number that is:
Less than zero: if the current OracleTimeStamp instance value is less than that of obj.
Zero: if the current OracleTimeStamp instance and obj values are equal.
Greater than zero: if the current OracleTimeStamp instance value is greater than that of obj.
IComparable
ArgumentException - The obj parameter is not of type OracleTimeStamp.
The following rules apply to the behavior of this method.
OracleTimeStamps. For example, comparing an OracleTimeStamp instance with an OracleBinary instance is not allowed. When an OracleTimeStamp is compared with a different type, an ArgumentException is thrown.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
Overrides Object
This method determines whether an object has the same date and time as the current OracleTimeStamp instance.
// C# public override bool Equals(object obj);
Returns true if the obj is of type OracleTimeStamp and represents the same date and time; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleTimeStamp that has a value is greater than an OracleTimeStamp that has a null value.
OracleTimeStamps that contain a null value are equal.
Overrides Object
This method returns a hash code for the OracleTimeStamp instance.
// C# public override int GetHashCode();
A number that represents the hash code.
This method subtracts an OracleTimeStamp value from the current instance and returns an OracleIntervalDS that represents the time difference between the supplied OracleTimeStamp structure and the current instance.
// C# public OracleIntervalDS GetDaysBetween(OracleTimeStamp value1);
An OracleIntervalDS that represents the interval between two OracleTimeStamp values.
If either the current instance or the parameter has a null value, the returned OracleIntervalDS has a null value.
This method subtracts an OracleTimeStamp value from the current instance and returns an OracleIntervalYM that represents the time difference between the OracleTimeStamp value and the current instance.
// C# public OracleIntervalYM GetYearsBetween(OracleTimeStamp value1);
An OracleIntervalYM that represents the interval between two OracleTimeStamp values.
If either the current instance or the parameter has a null value, the returned OracleIntervalYM has a null value.
This method converts the current OracleTimeStamp structure to an OracleDate structure.
// C# public OracleDate ToOracleDate();
The returned OracleDate contains the date and time in the current instance.
The precision of the OracleTimeStamp value can be lost during the conversion.
If the value of the OracleTimeStamp has a null value, the value of the returned OracleDate structure has a null value.
This method converts the current OracleTimeStamp structure to an OracleTimeStampLTZ structure.
// C# public OracleTimeStampLTZ ToOracleTimeStampLTZ();
The returned OracleTimeStampLTZ contains date and time in the current instance.
If the value of the current instance has a null value, the value of the returned OracleTimeStampLTZ structure has a null value.
This method converts the current OracleTimeStamp structure to an OracleTimeStampTZ structure.
// C# public OracleTimeStampTZ ToOracleTimeStampTZ();
The returned OracleTimeStampTZ contains the date and time from the OracleTimeStamp and the time zone from the OracleGlobalization.TimeZone of the thread.
If the value of the current instance has a null value, the value of the returned OracleTimeStampTZ structure has a null value.
Overrides Object
This method converts the current OracleTimeStamp structure to a string.
// C# public override string ToString();
A string that represents the same date and time as the current OracleTimeStamp structure.
The returned value is a string representation of an OracleTimeStamp in the format specified by the OracleGlobalization.TimeStampFormat property of the thread.
The names and abbreviations used for months and days are in the language specified by the OracleGlobalization's DateLanguage and Calendar properties of the thread. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_format for the OracleTimeStamp(string)constructor OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStamp from a string using the format specified. OracleTimeStamp ts = new OracleTimeStamp("11-NOV-1999 11:02:33.444 AM"); // Set the nls_timestamp_format for the ToString() method og.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(ts.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM"
|
|
![]() Copyright © 2002, 2003 Oracle Corporation. All Rights Reserved. |
|