The OracleTimeStampLTZ structure represents the Oracle TIMESTAMP WITH LOCAL TIME ZONE data type to be stored in or retrieved from a database. Each OracleTimeStampLTZ stores the following information: year, month, day, hour, minute, second, and nanosecond.
System.Object
System.ValueType
Oracle.DataAccess.Types.OracleTimeStampLTZ
// ADO.NET 2.0: C# public struct OracleTimeStampLTZ : IComparable, INullable, IXmlSerializable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C#
using System;
using Oracle.DataAccess.Types;
using Oracle.DataAccess.Client;
class OracleTimeStampLTZSample
{
static void Main()
{
// Illustrates usage of OracleTimeStampLTZ
// Display Local Time Zone Name
Console.WriteLine("Local Time Zone Name = " +
OracleTimeStampLTZ.GetLocalTimeZoneName());
OracleTimeStampLTZ tsLocal1 = OracleTimeStampLTZ.GetSysDate();
OracleTimeStampLTZ tsLocal2 = DateTime.Now;
// Calculate the difference between tsLocal1 and tsLocal2
OracleIntervalDS idsDiff = tsLocal2.GetDaysBetween(tsLocal1);
// Calculate the difference using AddNanoseconds()
int nanoDiff = 0;
while (tsLocal2 > tsLocal1)
{
nanoDiff += 10;
tsLocal1 = tsLocal1.AddNanoseconds(10);
}
Console.WriteLine("idsDiff.Nanoseconds = " + idsDiff.Nanoseconds);
Console.WriteLine("nanoDiff = " + nanoDiff);
}
}
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
ODP.NET Version: ODP.NET for .NET Framework 2.0 or ODP.NET for .NET Framework 4
See Also:
OracleTimeStampLTZ members are listed in the following tables:
OracleTimeStampLTZ Constructors
OracleTimeStampLTZ constructors are listed in Table 14-100
Table 14-100 OracleTimeStampLTZConstructors
| Constructor | Description |
|---|---|
|
Instantiates a new instance of |
OracleTimeStampLTZ Static Fields
The OracleTimeStampLTZ static fields are listed in Table 14-101.
Table 14-101 OracleTimeStampLTZ Static Fields
| Field | Description |
|---|---|
|
Represents the maximum valid date for an |
|
|
Represents the minimum valid date for an |
|
|
Represents a null value that can be assigned to an instance of the |
OracleTimeStampLTZ Static Methods
The OracleTimeStampLTZ static methods are listed in Table 14-102.
Table 14-102 OracleTimeStampLTZ Static Methods
| Methods | Description |
|---|---|
|
Determines if two |
|
|
Gets the client's local time zone name |
|
|
Gets the client's local time zone offset relative to UTC |
|
|
Gets an |
|
|
Determines if the first of two |
|
|
Determines if the first of two |
|
|
Determines if the first of two |
|
|
Determines if the first of two |
|
|
Determines if two |
|
|
Gets an |
|
|
Returns a new instance of an |
OracleTimeStampLTZ Static Operators
The OracleTimeStampLTZ static operators are listed in Table 14-103.
Table 14-103 OracleTimeStampLTZ Static Operators
| Operator | Description |
|---|---|
|
Adds the supplied instance value to the supplied |
|
|
Determines if two |
|
|
Determines if the first of two |
|
|
Determines if the first of two |
|
|
Determines if two |
|
|
Determines if the first of two |
|
|
Determines if the first of two |
|
|
Subtracts the supplied instance value from the supplied |
OracleTimeStampLTZ Static Type Conversions
The OracleTimeStampLTZ static type conversions are listed in Table 14-104.
Table 14-104 OracleTimeStampLTZ Static Type Conversions
| Operator | Description |
|---|---|
|
Converts an instance value to an |
|
|
Converts an instance value to an |
|
|
Converts an |
The OracleTimeStampLTZ properties are listed in Table 14-105.
Table 14-105 OracleTimeStampLTZ Properties
| Properties | Description |
|---|---|
|
Returns an array of bytes that represents an |
|
|
Specifies the |
|
|
Indicates whether or not the |
|
|
Specifies the hour component of an |
|
|
Specifies the millisecond component of an |
|
|
Specifies the minute component of an |
|
|
Specifies the month component of an |
|
|
Specifies the nanosecond component of an |
|
|
Specifies the second component of an |
|
|
Specifies the date and time that is stored in the |
|
|
Specifies the year component of an |
The OracleTimeStampLTZ methods are listed in Table 14-106.
Table 14-106 OracleTimeStampLTZ Methods
| Methods | Description |
|---|---|
|
Adds the supplied number of days to the current instance |
|
|
Adds the supplied number of hours to the current instance |
|
|
Adds the supplied number of milliseconds to the current instance |
|
|
Adds the supplied number of minutes to the current instance |
|
|
Adds the supplied number of months to the current instance |
|
|
Adds the supplied number of nanoseconds to the current instance |
|
|
Adds the supplied number of seconds to the current instance |
|
|
Adds the supplied number of years to the current instance |
|
|
Compares the current |
|
|
Determines whether or not an object has the same date and time as the current |
|
|
Returns a hash code for the |
|
|
Subtracts an |
|
|
Subtracts an |
|
|
GetType |
Inherited from |
|
Converts the current |
|
|
Converts the current |
|
|
Converts the current |
|
|
Converts the current |
|
|
Converts the current local time to Coordinated Universal Time (UTC) |
The OracleTimeStampLTZ constructors create new instances of the OracleTimeStampLTZ structure.
This constructor creates a new instance of the OracleTimeStampLTZ structure and sets its value for date and time using the supplied DateTime value.
This constructor creates a new instance of the OracleTimeStampLTZ structure and sets its value for date and time using the supplied string.
OracleTimeStampLTZ(int, int, int)
This constructor creates a new instance of the OracleTimeStampLTZ structure and sets its value for date using year, month, and day.
OracleTimeStampLTZ(int, int, int, int, int, int)
This constructor creates a new instance of the OracleTimeStampLTZ structure and sets its value for date and time using year, month, day, hour, minute, and second.
OracleTimeStampLTZ(int, int, int, int, int, int, double)
This constructor creates a new instance of the OracleTimeStampLTZ structure and sets its value for date and time using year, month, day, hour, minute, second, and millisecond.
OracleTimeStampLTZ(int, int, int, int, int, int, int)
This constructor creates a new instance of the OracleTimeStampLTZ 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 OracleTimeStampLTZ structure and sets its value to the provided byte array, which is in the internal Oracle TIMESTAMP WITH LOCAL TIME ZONE format.
See Also:
This constructor creates a new instance of the OracleTimeStampLTZ structure and sets its value for date and time using the supplied DateTime value.
// C# public OracleTimeStampLTZ (DateTime dt);
dt
The supplied DateTime value.
ArgumentException - The dt parameter cannot be used to construct a valid OracleTimeStampLTZ.
This constructor creates a new instance of the OracleTimeStampLTZ structure and sets its value for date and time using the supplied string.
// C# public OracleTimeStampLTZ(string tsStr);
tsStr
A string that represents an Oracle TIMESTAMP WITH LOCAL TIME ZONE.
ArgumentException - The tsStr is an invalid string representation of an Oracle TIMESTAMP WITH LOCAL TIME ZONE or the supplied tsStr is not in the timestamp format specified by the OracleGlobalization.TimeStampFormat property of the thread, which represents the Oracle 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#
using System;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
class OracleTimeStampLTZSample
{
static void Main()
{
// Set the nls_timestamp_format for the OracleTimeStampLTZ(string)
// constructor
OracleGlobalization info = OracleGlobalization.GetClientInfo();
info.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM";
OracleGlobalization.SetThreadInfo(info);
// construct OracleTimeStampLTZ from a string using the format
// specified.
OracleTimeStampLTZ ts =
new OracleTimeStampLTZ("11-NOV-1999 11:02:33.444 AM");
// Set the nls_timestamp_format for the ToString() method
info.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM";
OracleGlobalization.SetThreadInfo(info);
// Prints "1999-NOV-11 11:02:33.444000000 AM"
Console.WriteLine(ts.ToString());
}
}
See Also:
Oracle Database SQL Reference for further information on date format elements
This constructor creates a new instance of the OracleTimeStampLTZ structure and sets its value for date using year, month, and day.
// C# public OracleTimeStampLTZ(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 OracleTimeStampLTZ (that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStampLTZ structure and sets its value for date and time using year, month, day, hour, minute, and second.
// C# public OracleTimeStampLTZ (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 OracleTimeStampLTZ (that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStampLTZ structure and sets its value for date and time using year, month, day, hour, minute, second, and millisecond.
// C# public OracleTimeStampLTZ(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 OracleTimeStampLTZ (that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStampLTZ structure and sets its value for date and time using year, month, day, hour, minute, second, and nanosecond.
// C# public OracleTimeStampLTZ (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 OracleTimeStampLTZ (that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStampLTZ structure and sets its value to the provided byte array, which is in the internal Oracle TIMESTAMP WITH LOCAL TIME ZONE format.
// C#
public OracleTimeStampLTZ (byte[] bytes);
bytes
A byte array that represents an Oracle TIMESTAMP WITH LOCAL TIME ZONE in Oracle internal format.
ArgumentException - bytes is not in an internal Oracle TIMESTAMP WITH LOCAL TIME ZONE format or bytes is not a valid Oracle TIMESTAMP WITH LOCAL TIME ZONE.
ArgumentNullException - bytes is null.
The OracleTimeStampLTZ static fields are listed in Table 14-107.
Table 14-107 OracleTimeStampLTZ Static Fields
| Field | Description |
|---|---|
|
Represents the maximum valid date for an |
|
|
Represents the minimum valid date for an |
|
|
Represents a null value that can be assigned to an instance of the |
See Also:
This static field represents the maximum valid date for an OracleTimeStampLTZ structure, which is December 31, 9999 23:59:59.999999999.
// C# public static readonly OracleTimeStampLTZ MaxValue;
This value is the maximum date and time in the client time zone.
This static field represents the minimum valid date for an OracleTimeStampLTZ structure, which is January 1, -4712 0:0:0.
// C# public static readonly OracleTimeStampLTZ MinValue;
This value is the minimum date and time in the client time zone.
The OracleTimeStampLTZ static methods are listed in Table 14-108.
Table 14-108 OracleTimeStampLTZ Static Methods
| Methods | Description |
|---|---|
|
Determines if two |
|
|
Gets the client's local time zone name |
|
|
Gets the client's local time zone offset relative to UTC |
|
|
Gets an |
|
|
Determines if the first of two |
|
|
Determines if the first of two |
|
|
Determines if the first of two |
|
|
Determines if the first of two |
|
|
Determines if two |
|
|
Gets an |
|
|
Returns a new instance of an |
See Also:
This static method determines if two OracleTimeStampLTZ values are equal.
// C# public static bool Equals(OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
The first OracleTimeStampLTZ.
value2
The second OracleTimeStampLTZ.
Returns true if two OracleTimeStampLTZ values are equal. Returns false otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
This static method gets the client's local time zone name.
// C# public static string GetLocalTimeZoneName();
A string containing the local time zone.
This static method gets the client's local time zone offset relative to Coordinated Universal Time (UTC).
// C# public static TimeSpan GetLocalTimeZoneOffset( );
A TimeSpan structure containing the local time zone hours and time zone minutes.
This static method gets an OracleTimeStampLTZ structure that represents the current date and time.
// C# public static OracleTimeStampLTZ GetSysDate();
An OracleTimeStampLTZ structure that represents the current date and time.
This static method determines if the first of two OracleTimeStampLTZ values is greater than the second.
// C# public static bool GreaterThan(OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
The first OracleTimeStampLTZ.
value2
The second OracleTimeStampLTZ.
Returns true if the first of two OracleTimeStampLTZ values is greater than the second; otherwise, returns false.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
This static method determines if the first of two OracleTimeStampLTZ values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
The first OracleTimeStampLTZ.
value2
The second OracleTimeStampLTZ.
Returns true if the first of two OracleTimeStampLTZ values is greater than or equal to the second; otherwise, returns false.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
This static method determines if the first of two OracleTimeStampLTZ values is less than the second.
// C# public static bool LessThan(OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
The first OracleTimeStampLTZ.
value2
The second OracleTimeStampLTZ.
Returns true if the first of two OracleTimeStampLTZ values is less than the second. Returns false otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
This static method determines if the first of two OracleTimeStampLTZ values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
The first OracleTimeStampLTZ.
value2
The second OracleTimeStampLTZ.
Returns true if the first of two OracleTimeStampLTZ values is less than or equal to the second. Returns false otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
This static method determines if two OracleTimeStampLTZ values are not equal.
// C# public static bool NotEquals(OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
The first OracleTimeStampLTZ.
value2
The second OracleTimeStampLTZ.
Returns true if two OracleTimeStampLTZ values are not equal. Returns false otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
This static method creates an OracleTimeStampLTZ structure and sets its value using the supplied string.
// C#
public static OracleTimeStampLTZ Parse(string tsStr);
tsStr
A string that represents an Oracle TIMESTAMP WITH LOCAL TIME ZONE.
An OracleTimeStampLTZ structure.
ArgumentException - The tsStr parameter is an invalid string representation of an Oracle TIMESTAMP WITH LOCAL TIME ZONE or the tsStr is not in the timestamp format specified by the OracleGlobalization.TimeStampFormat property of the thread, which represents the Oracle 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#
using System;
using Oracle.DataAccess.Types;
using Oracle.DataAccess.Client;
class ParseSample
{
static void Main()
{
// Set the nls_timestamp_format for the Parse() method
OracleGlobalization info = OracleGlobalization.GetClientInfo();
info.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM";
OracleGlobalization.SetThreadInfo(info);
// construct OracleTimeStampLTZ from a string using the format specified.
OracleTimeStampLTZ ts =
OracleTimeStampLTZ.Parse("11-NOV-1999 11:02:33.444 AM");
// Set the nls_timestamp_format for the ToString() method
info.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM";
OracleGlobalization.SetThreadInfo(info);
// Prints "1999-NOV-11 11:02:33.444000000 AM"
Console.WriteLine(ts.ToString());
}
}
This static method returns a new instance of an OracleTimeStampLTZ with the specified fractional second precision.
// C# public static OracleTimeStampLTZ SetPrecision(OracleTimeStampLTZ value1, int fracSecPrecision);
value1
The provided OracleTimeStampLTZ object.
fracSecPrecision
The fractional second precision provided. Range of fractional second precision is (0 to 9).
An OracleTimeStampLTZ structure with the specified fractional second precision
ArgumentOutOfRangeException - fracSecPrecision is out of the specified range.
The value specified in the supplied fracSecPrecision parameter is used to perform a rounding off operation on the supplied OracleTimeStampLTZ value. Depending on this value, 0 or more trailing zeros are displayed in the string returned by ToString().
The OracleTimeStampLTZ 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 OracleTimeStampLTZ static operators are listed in Table 14-109.
Table 14-109 OracleTimeStampLTZ Static Operators
| Operator | Description |
|---|---|
|
Adds the supplied instance value to the supplied |
|
|
Determines if two |
|
|
Determines if the first of two |
|
|
Determines if the first of two |
|
|
Determines if two |
|
|
Determines if the first of two |
|
|
Determines if the first of two |
|
|
Subtracts the supplied instance value from the supplied |
See Also:
operator+ adds the supplied value to the supplied OracleTimeStampLTZ and returns a new OracleTimeStampLTZ structure.
operator + (OracleTimeStampLTZ, OracleIntervalDS)
This static operator adds the supplied OracleIntervalDS to the supplied OracleTimeStampLTZ and returns a new OracleTimeStampLTZ structure.
operator + (OracleTimeStampLTZ, OracleIntervalYM)
This static operator adds the supplied OracleIntervalYM to the supplied OracleTimeStampLTZ and returns a new OracleTimeStampLTZ structure.
operator + (OracleTimeStampLTZ, TimeSpan)
This static operator adds the supplied TimeSpan to the supplied OracleTimeStampLTZ and returns a new OracleTimeStampLTZ structure.
This static operator adds the supplied OracleIntervalDS to the supplied OracleTimeStampLTZ and returns a new OracleTimeStampLTZ structure.
// C# public static operator +(OracleTimeStampLTZ value1, OracleIntervalDS value2);
value1
An OracleTimeStampLTZ.
value2
An OracleIntervalDS.
An OracleTimeStampLTZ.
If either parameter has a null value, the returned OracleTimeStampLTZ has a null value.
This static operator adds the supplied OracleIntervalYM to the supplied OracleTimeStampLTZ and returns a new OracleTimeStampLTZ structure.
// C# public static operator +(OracleTimeStampLTZ value1, OracleIntervalYM value2);
value1
An OracleTimeStampLTZ.
value2
An OracleIntervalYM.
An OracleTimeStampLTZ.
If either parameter has a null value, the returned OracleTimeStampLTZ has a null value.
This static operator adds the supplied TimeSpan to the supplied OracleTimeStampLTZ and returns a new OracleTimeStampLTZ structure.
// C# public static operator +(OracleTimeStampLTZ value1, TimeSpan value2);
value1
An OracleTimeStampLTZ.
value2
A TimeSpan.
An OracleTimeStampLTZ.
If the OracleTimeStampLTZ instance has a null value, the returned OracleTimeStampLTZ has a null value.
This static operator determines if two OracleTimeStampLTZ values are equal.
// C# public static bool operator == (OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
The first OracleTimeStampLTZ.
value2
The second OracleTimeStampLTZ.
Returns true if they are the same; otherwise, returns false.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampLTZ values is greater than the second.
// C# public static bool operator > (OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
The first OracleTimeStampLTZ.
value2
The second OracleTimeStampLTZ.
Returns true if the first OracleTimeStampLTZ value is greater than the second; otherwise, returns false.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampLTZ values is greater than or equal to the second.
// C# public static bool operator >= (OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
An OracleTimeStampLTZ.
value2
The second OracleTimeStampLTZ.
Returns true if the first OracleTimeStampLTZ is greater than or equal to the second; otherwise, returns false.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
This static operator determines if two OracleTimeStampLTZ values are not equal.
// C# public static bool operator != (OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
The first OracleTimeStampLTZ.
value2
The second OracleTimeStampLTZ.
Returns true if two OracleTimeStampLTZ values are not equal; otherwise returns false.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampLTZ values is less than the second.
// C# public static bool operator < (OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
The first OracleTimeStampLTZ.
value2
The second OracleTimeStampLTZ.
Returns true if the first OracleTimeStampLTZ is less than the second; otherwise, returns false.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampLTZ values is less than or equal to the second.
// C# public static bool operator <= (OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
The first OracleTimeStampLTZ.
value2
The second OracleTimeStampLTZ.
Returns true if the first OracleTimeStampLTZ is less than or equal to the second; otherwise, returns false.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
operator- subtracts the supplied value, from the supplied OracleTimeStampLTZ value, and returns a new OracleTimeStampLTZ structure.
operator - (OracleTimeStampLTZ, OracleIntervalDS)
This static operator subtracts the supplied OracleIntervalDS value, from the supplied OracleTimeStampLTZ value, and return a new OracleTimeStampLTZ structure.
operator - (OracleTimeStampLTZ, OracleIntervalYM)
This static operator subtracts the supplied OracleIntervalYM value, from the supplied OracleTimeStampLTZ value, and returns a new OracleTimeStampLTZ structure.
operator - (OracleTimeStampLTZ, TimeSpan)
This static operator subtracts the supplied TimeSpan value, from the supplied OracleTimeStampLTZ value, and returns a new OracleTimeStampLTZ structure.
This static operator subtracts the supplied OracleIntervalDS value, from the supplied OracleTimeStampLTZ value, and return a new OracleTimeStampLTZ structure.
// C# public static operator - (OracleTimeStampLTZ value1, OracleIntervalDS value2);
value1
An OracleTimeStampLTZ.
value2
An OracleIntervalDS instance.
An OracleTimeStampLTZ structure.
If either parameter has a null value, the returned OracleTimeStampLTZ has a null value.
This static operator subtracts the supplied OracleIntervalYM value, from the supplied OracleTimeStampLTZ value, and returns a new OracleTimeStampLTZ structure.
// C# public static operator - (OracleTimeStampLTZ value1, OracleIntervalYM value2);
value1
An OracleTimeStampLTZ.
value2
An OracleIntervalYM.
An OracleTimeStampLTZ structure.
If either parameter has a null value, the returned OracleTimeStampLTZ has a null value.
This static operator subtracts the supplied TimeSpan value, from the supplied OracleTimeStampLTZ value, and returns a new OracleTimeStampLTZ structure.
// C# public static operator -(OracleTimeStampLTZ value1, TimeSpan value2);
value1
An OracleTimeStampLTZ.
value2
A TimeSpan.
An OracleTimeStampLTZ structure.
If the OracleTimeStampLTZ instance has a null value, the returned OracleTimeStampLTZ structure has a null value.
The OracleTimeStampLTZ static type conversions are listed in Table 14-110.
Table 14-110 OracleTimeStampLTZ Static Type Conversions
| Operator | Description |
|---|---|
|
Converts an instance value to an |
|
|
Converts an instance value to an |
|
|
Converts an |
See Also:
explicit operator OracleTimeStampLTZ converts the supplied value to an OracleTimeStampLTZ structure.
explicit operator OracleTimeStampLTZ(OracleTimeStamp)
This static type conversion operator converts an OracleTimeStamp value to an OracleTimeStampLTZ structure.
explicit operator OracleTimeStampLTZ(OracleTimeStampTZ)
This static type conversion operator converts an OracleTimeStampTZ value to an OracleTimeStampLTZ structure.
explicit operator OracleTimeStampLTZ(string)
This static type conversion operator converts the supplied string to an OracleTimeStampLTZ structure.
This static type conversion operator converts an OracleTimeStamp value to an OracleTimeStampLTZ structure.
// C#
public static explicit operator OracleTimeStampLTZ (OracleTimeStamp value1);
value1
An OracleTimeStamp.
The OracleTimeStampLTZ structure contains the date and time of the OracleTimeStampTZ structure.
If the OracleTimeStamp structure has a null value, the returned OracleTimeStampLTZ structure also has a null value.
This static type conversion operator converts an OracleTimeStampTZ value to an OracleTimeStampLTZ structure.
// C#
public static explicit operator OracleTimeStampLTZ
(OracleTimeStampTZ value1);
value1
An OracleTimeStampTZ instance.
The OracleTimeStampLTZ structure contains the date and time in the OracleTimeStampTZ structure (which is normalized to the client local time zone).
If the OracleTimeStampTZ structure has a null value, the returned OracleTimeStampLTZ structure also has a null value.
This static type conversion operator converts the supplied string to an OracleTimeStampLTZ structure.
// C#
public static explicit operator OracleTimeStampLTZ (string tsStr);
tsStr
A string representation of an Oracle TIMESTAMP WITH LOCAL TIME ZONE.
A OracleTimeStampLTZ.
ArgumentException - ThetsStr parameter is an invalid string representation of an Oracle TIMESTAMP WITH LOCAL TIME ZONE or the tsStr is not in the timestamp format specified by the thread's OracleGlobalization.TimeStampFormat property, which represents the Oracle 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#
using System;
using Oracle.DataAccess.Types;
using Oracle.DataAccess.Client;
class OracleTimeStampLTZSample
{
static void Main()
{
// Set the nls_timestamp_format for the OracleTimeStampLTZ(string)
// constructor
OracleGlobalization info = OracleGlobalization.GetClientInfo();
info.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM";
OracleGlobalization.SetThreadInfo(info);
// construct OracleTimeStampLTZ from a string using the format specified.
OracleTimeStampLTZ ts =
new OracleTimeStampLTZ("11-NOV-1999 11:02:33.444 AM");
// Set the nls_timestamp_format for the ToString() method
info.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM";
OracleGlobalization.SetThreadInfo(info);
// Prints "1999-NOV-11 11:02:33.444000000 AM"
Console.WriteLine(ts.ToString());
}
}
See Also:
Oracle Database SQL Reference for further information on datetime format elements
implicit operator OracleTimeStampLTZ converts the supplied structure to an OracleTimeStampLTZ structure.
implicit operator OracleTimeStampLTZ(OracleDate)
This static type conversion operator converts an OracleDate value to an OracleTimeStampLTZ structure.
implicit operator OracleTimeStampLTZ(DateTime)
This static type conversion operator converts a DateTime structure to an OracleTimeStampLTZ structure.
This static type conversion operator converts an OracleDate value to an OracleTimeStampLTZ structure.
// C#
public static implicit operator OracleTimeStampLTZ(OracleDate value1);
value1
An OracleDate.
The returned OracleTimeStampLTZ structure contains the date and time in the OracleDate structure.
If the OracleDate structure has a null value, the returned OracleTimeStampLTZ structure also has a null value.
This static type conversion operator converts a DateTime structure to an OracleTimeStampLTZ structure.
// C#
public static implicit operator OracleTimeStampLTZ(DateTime value1);
value1
A DateTime structure.
An OracleTimeStampLTZ structure.
This static type conversion operator converts an OracleTimeStampLTZ value to a DateTime structure.
// C#
public static explicit operator DateTime(OracleTimeStampLTZ value1);
value1
An OracleTimeStampLTZ instance.
A DateTime that contains the date and time in the current instance.
OracleNullValueException - The OracleTimeStampLTZ structure has a null value.
The precision of the OracleTimeStampLTZ value can be lost during the conversion.
The OracleTimeStampLTZ properties are listed in Table 14-111.
Table 14-111 OracleTimeStampLTZ Properties
| Properties | Description |
|---|---|
|
Returns an array of bytes that represents an |
|
|
Specifies the |
|
|
Indicates whether or not the |
|
|
Specifies the hour component of an |
|
|
Specifies the millisecond component of an |
|
|
Specifies the minute component of an |
|
|
Specifies the month component of an |
|
|
Specifies the nanosecond component of an |
|
|
Specifies the second component of an |
|
|
Specifies the date and time that is stored in the |
|
|
Specifies the year component of an |
See Also:
This property returns an array of bytes that represents an Oracle TIMESTAMP WITH LOCAL TIME ZONE in Oracle internal format.
// C#
public byte[] BinData {get;}
A byte array that represents an Oracle TIMESTAMP WITH LOCAL TIME ZONE internal format.
OracleNullValueException - The current instance has a null value.
This property specifies the day component of an OracleTimeStampLTZ.
// 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 or not the current instance has a null value.
// C#
public bool IsNull{get;}
Returns true if the current instance contains a null value; otherwise, returns false.
This property specifies the hour component of an OracleTimeStampLTZ.
// 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 OracleTimeStampLTZ.
// 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 OracleTimeStampLTZ.
// 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 OracleTimeStampLTZ.
// 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 OracleTimeStampLTZ.
// 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 OracleTimeStampLTZ.
// 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 OracleTimeStampLTZ structure.
// C#
public DateTime Value{get;}
A DateTime.
OracleNullValueException - The current instance has a null value.
The OracleTimeStampLTZ methods are listed in Table 14-112.
Table 14-112 OracleTimeStampLTZ Methods
| Methods | Description |
|---|---|
|
Adds the supplied number of days to the current instance |
|
|
Adds the supplied number of hours to the current instance |
|
|
Adds the supplied number of milliseconds to the current instance |
|
|
Adds the supplied number of minutes to the current instance |
|
|
Adds the supplied number of months to the current instance |
|
|
Adds the supplied number of nanoseconds to the current instance |
|
|
Adds the supplied number of seconds to the current instance |
|
|
Adds the supplied number of years to the current instance |
|
|
Compares the current |
|
|
Determines whether or not an object has the same date and time as the current |
|
|
Returns a hash code for the |
|
|
Subtracts an |
|
|
Subtracts an |
|
|
GetType |
Inherited from |
|
Converts the current |
|
|
Converts the current |
|
|
Converts the current |
|
|
Converts the current |
|
|
Converts the current local time to Coordinated Universal Time (UTC) |
See Also:
This method adds the supplied number of days to the current instance.
// C#
public OracleTimeStampLTZ AddDays(double days);
days
The supplied number of days. Range is (-1,000,000,000 < days < 1,000,000,000)
An OracleTimeStampLTZ.
OracleNullValueException - The current instance has a null value.
ArgumentOutofRangeException - The argument value is out of the specified range.
This method adds the supplied number of hours to the current instance.
// C#
public OracleTimeStampLTZ AddHours(double hours);
hours
The supplied number of hours. Range is (-24,000,000,000 < hours < 24,000,000,000).
An OracleTimeStampLTZ.
OracleNullValueException - The current instance has a null value.
ArgumentOutofRangeException - The argument value is out of the specified range.
This method adds the supplied number of milliseconds to the current instance.
// C#
public OracleTimeStampLTZ AddMilliseconds(double milliseconds);
milliseconds
The supplied number of milliseconds. Range is (-8.64 * 1016< milliseconds < 8.64 * 1016).
An OracleTimeStampLTZ.
OracleNullValueException - The current instance has a null value.
ArgumentOutofRangeException - The argument value is out of the specified range.
This method adds the supplied number of minutes to the current instance.
// C#
public OracleTimeStampLTZ AddMinutes(double minutes);
minutes
The supplied number of minutes. Range is (-1,440,000,000,000 < minutes < 1,440,000,000,000).
An OracleTimeStampLTZ.
OracleNullValueException - The current instance has a null value.
ArgumentOutofRangeException - The argument value is out of the specified range.
This method adds the supplied number of months to the current instance.
// C#
public OracleTimeStampLTZ AddMonths(long months);
months
The supplied number of months. Range is (-12,000,000,000 < months < 12,000,000,000).
An OracleTimeStampLTZ.
OracleNullValueException - The current instance has a null value.
ArgumentOutofRangeException - The argument value is out of the specified range.
This method adds the supplied number of nanoseconds to the current instance.
// C#
public OracleTimeStampLTZ AddNanoseconds(long nanoseconds);
nanoseconds
The supplied number of nanoseconds.
An OracleTimeStampLTZ.
OracleNullValueException - The current instance has a null value.
This method adds the supplied number of seconds to the current instance.
// C#
public OracleTimeStampLTZ AddSeconds(double seconds);
seconds
The supplied number of seconds. Range is (-8.64 * 1013< seconds < 8.64 * 1013).
An OracleTimeStampLTZ.
OracleNullValueException - The current instance has a null value.
ArgumentOutofRangeException - The argument value is out of the specified range.
This method adds the supplied number of years to the current instance
// C#
public OracleTimeStampLTZ AddYears(int years);
years
The supplied number of years. Range is (-999,999,999 <= years < = 999,999,999)
An OracleTimeStampLTZ.
OracleNullValueException - The current instance has a null value.
ArgumentOutofRangeException - The argument value is out of the specified range.
This method compares the current OracleTimeStampLTZ instance to an object, and returns an integer that represents their relative values.
// C#
public int CompareTo(object obj);
obj
The object being compared to the current OracleTimeStampLTZ instance.
The method returns a number that is:
Less than zero: if the current OracleTimeStampLTZ instance value is less than that of obj.
Zero: if the current OracleTimeStampLTZ instance and obj values are equal.
Greater than zero: if the current OracleTimeStampLTZ instance value is greater than that of obj.
IComparable
ArgumentException - The obj parameter is not of type OracleTimeStampLTZ.
The following rules apply to the behavior of this method.
The comparison must be between OracleTimeStampLTZs. For example, comparing an OracleTimeStampLTZ instance with an OracleBinary instance is not allowed. When an OracleTimeStampLTZ is compared with a different type, an ArgumentException is thrown.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
Overrides Object
This method determines whether or not an object has the same date and time as the current OracleTimeStampLTZ instance.
// C#
public override bool Equals(object obj);
obj
The object being compared to the current OracleTimeStampLTZ instance.
Returns true if the obj is of type OracleTimeStampLTZ and represents the same date and time; otherwise, returns false.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ that has a value is greater than an OracleTimeStampLTZ that has a null value.
Two OracleTimeStampLTZs that contain a null value are equal.
Overrides Object
This method returns a hash code for the OracleTimeStampLTZ instance.
// C# public override int GetHashCode();
A number that represents the hash code.
This method subtracts an OracleTimeStampLTZ value from the current instance and returns an OracleIntervalDS that represents the difference.
// C#
public OracleIntervalDS GetDaysBetween(OracleTimeStampLTZ value1);
value1
The OracleTimeStampLTZ value being subtracted.
An OracleIntervalDS that represents the interval between two OracleTimeStampLTZ values.
If either the current instance or the parameter has a null value, the returned OracleIntervalDS has a null value.
This method subtracts an OracleTimeStampLTZ value from the current instance and returns an OracleIntervalYM that represents the time interval.
// C#
public OracleIntervalYM GetYearsBetween(OracleTimeStampLTZ value1);
value1
The OracleTimeStampLTZ value being subtracted.
An OracleIntervalYM that represents the interval between two OracleTimeStampLTZ 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 OracleTimeStampLTZ structure to an OracleDate structure.
// C# public OracleDate ToOracleDate();
The returned OracleDate structure contains the date and time in the current instance.
The precision of the OracleTimeStampLTZ value can be lost during the conversion.
If the current instance has a null value, the value of the returned OracleDate structure has a null value.
This method converts the current OracleTimeStampLTZ structure to an OracleTimeStamp structure.
// C# public OracleTimeStamp ToOracleTimeStamp();
The returned OracleTimeStamp contains the date and time in the current instance.
If the current instance has a null value, the value of the returned OracleTimeStamp structure has a null value.
This method converts the current OracleTimeStampLTZ structure to an OracleTimeStampTZ structure.
// C# public OracleTimeStampTZ ToOracleTimeStampTZ();
The returned OracleTimeStampTZ contains the date and time of the current instance, with the time zone set to the OracleGlobalization.TimeZone from the thread.
If 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 OracleTimeStampLTZ structure to a string.
// C# public override string ToString();
A string that represents the same date and time as the current OracleTimeStampLTZ structure.
The returned value is a string representation of the OracleTimeStampLTZ 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 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#
using System;
using Oracle.DataAccess.Types;
using Oracle.DataAccess.Client;
class ToStringSample
{
static void Main()
{
// Set the nls_timestamp_format for the OracleTimeStampLTZ(string)
// constructor
OracleGlobalization info = OracleGlobalization.GetClientInfo();
info.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM";
OracleGlobalization.SetThreadInfo(info);
// construct OracleTimeStampLTZ from a string using the format
// specified.
OracleTimeStampLTZ ts =
new OracleTimeStampLTZ("11-NOV-1999 11:02:33.444 AM");
// Set the nls_timestamp_format for the ToString() method
info.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM";
OracleGlobalization.SetThreadInfo(info);
// Prints "1999-NOV-11 11:02:33.444000000 AM"
Console.WriteLine(ts.ToString());
}
}