Oracle Data Provider for .NET Developer's Guide Release 9.2.0.2 Part Number A96160-01 |
|
Oracle.DataAccess.Types Namespace (ODP.NET Types), 10 of 17
The OracleTimeStampTZ
structure represents the Oracle TIMESTAMP
WITH
TIME
ZONE
data type to be stored in or retrieved from a database. Each OracleTimeStampTZ
stores the following information: year, month, day, hour, minute, second, nanosecond, and time zone.
Object
ValueType
OracleTimeStampTZ
// C#
public struct OracleTimeStampTZ : IComparable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C#
// Illustrates usage of OracleTimeStampTZ
// Set the nls parameters for the current thread
OracleGlobalization og = OracleGlobalization.GetClientInfo();
og.TimeZone = "US/Eastern";
og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM";
og.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR";
OracleGlobalization.SetThreadInfo(og);
// Create an OracleTimeStampTZ in US/Pacific time zone
OracleTimeStampTZ tstz1=new OracleTimeStampTZ("11-NOV-1999 "+
"11:02:33.444 AM US/Pacific");
// Note that ToOracleTimeStampTZ uses the thread's time zone region,"US/Eastern"
OracleTimeStamp ts = new OracleTimeStamp("11-NOV-1999 11:02:33.444 AM");
OracleTimeStampTZ tstz2 = ts.ToOracleTimeStampTZ();
// Calculate the difference between tstz1 and tstz2
OracleIntervalDS idsDiff = tstz1.GetDaysBetween(tstz2);
// Display information
Console.WriteLine("tstz1.TimeZone = " + tstz1.TimeZone); //Prints "US/Pacific"
Console.WriteLine("tstz2.TimeZone = " + tstz2.TimeZone); // Prints "US/Eastern"
Console.WriteLine("idsDiff.Hours = " + idsDiff.Hours); // Prints 3
Console.WriteLine("idsDiff.Minutes = " + idsDiff.Minutes); // Prints 0
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccesss.dll
OracleTimeStampTZ
members are listed in the following tables:
OracleTimeStampTZ
constructors are listed in Table 5-113
Constructor | Description |
---|---|
Instantiates a new instance of OracleTimeStampTZ structure (Overloaded) |
The OracleTimeStampTZ
static fields are listed in Table 5-114.
The OracleTimeStampTZ
static methods are listed in Table 5-115.
The OracleTimeStampTZ
static operators are listed in Table 5-116.
The OracleTimeStampTZ
static type conversions are listed in Table 5-117.
The OracleTimeStampTZ
properties are listed in Table 5-118.
The OracleTimeStampTZ
methods are listed in Table 5-119.
The OracleTimeStampTZ
constructors create new instances of the OracleTimeStampTZ
structure.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using the supplied DateTime
value.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using the supplied DateTime
value and the supplied time zone data.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using the supplied string.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, and day.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, and time zone data.
This constructor creates a new instance of the OracleTimeStampTZ
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 OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and time zone data.
This constructor creates a new instance of the OracleTimeStampTZ
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 OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, millisecond, and time zone data.
This constructor creates a new instance of the OracleTimeStampTZ
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 OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, nanosecond, and time zone data.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value to the provided byte array, that represents the internal Oracle TIMESTAMP
WITH
TIME
ZONE
format.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using the supplied DateTime
value.
// C#public OracleTimeStampTZ (DateTime
dt);
The time zone is set to the OracleGlobalization.TimeZone
of the thread.
ArgumentException
- The dt
parameter cannot be used to construct a valid OracleTimeStampTZ
.
This constructor creates a new instance of the OracleTimeStampTZ
structure with the supplied DateTime
value and the time zone data.
// C#public OracleTimeStampTZ (DateTime
value1,string
timeZone);
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampTZ
.
timeZone
can be either an hour offset, for example, 7:00, or a valid time zone region name that is provided in V$TIMEZONE_NAMES
, such as US/Pacific. Time zone abbreviations are not supported.
If time zone is null, the OracleGlobalization.TimeZone
of the thread is used.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using the supplied string.
// C#public OracleTimeStampTZ (string
tsStr);
ArgumentException
- The tsStr
is an invalid string representation of an Oracle TIMESTAMP
WITH
TIME
ZONE
or the tsStr
is not in the timestamp format specified by the OracleGlobalization
.TimeStampTZFormat
property of the thread.
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_tz_format OracleTimeStampTZ(string) constructor OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStampTZ from a string using the format specified. OracleTimeStampTZ tstz = new OracleTimeStampTZ("11-NOV-1999" + "11:02:33.444 AM US/Pacific"); // Set the nls_timestamp_tz_format for the ToString() method og.TimeStampTZFormat = "YYYY-MON-DD HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(tstz.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM US/Pacific"
See Also:
|
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, and day.
// C#
public
OracleTimeStampTZ(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 OracleTimeStampTZ
(that is, the day is out of range for the month).
The time zone is set to the OracleGlobalization.TimeZone
of the thread.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, and time zone data.
// C#public OracleTimeStampTZ (int
year, int
month, int
day, string
timeZone);
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).
timeZone
The time zone data provided.
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 OracleTimeStampTZ
(that is, the day is out of range for the month or the time zone is invalid).
timeZone
can be either an hour offset, for example, 7:00, or a valid time zone region name that is provided in V$TIMEZONE_NAMES
, such as US/Pacific. Time zone abbreviations are not supported.
If time zone is null, the OracleGlobalization.TimeZone
of the thread is used.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, and second.
// C#public OracleTimeStampTZ(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 OracleTimeStampTZ
(that is, the day is out of range for the month).
The time zone is set to the OracleGlobalization.TimeZone
of the thread.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and time zone data.
// C#
public
OracleTimeStampTZ (int year, int month, int day, int hour, int minute,
int second, string timeZone);
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).
timeZone
The time zone data provided.
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 OracleTimeStampTZ
(that is, the day is out of range of the month or the time zone is invalid).
timeZone
can be either an hour offset, for example, 7:00, or a valid time zone region name that is provided in V$TIMEZONE_NAMES
, such as US/Pacific. Time zone abbreviations are not supported.
If time zone is null, the OracleGlobalization.TimeZone
of the thread is used.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and millisecond.
// C#
public
OracleTimeStampTZ (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).
millisecond
The millisecond 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 OracleTimeStampTZ
(that is, the day is out of range for the month).
The time zone is set to the OracleGlobalization.TimeZone
of the thread.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, millisecond, and time zone data.
// C#
public
OracleTimeStampTZ (int year, int month, int day, int hour, int minute,
int second, double millisecond, string timeZone);
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).
millisecond
The millisecond provided. Range of millisecond
is (0 to 999.999999).
timeZone
The time zone data provided.
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 OracleTimeStampTZ
(that is, the day is out of range for the month or the time zone is invalid).
timeZone
can be either an hour offset, for example, 7:00, or a valid time zone region name that is provided in V$TIMEZONE_NAMES
, such as US/Pacific. Time zone abbreviations are not supported.
If time zone is null, the OracleGlobalization.TimeZone
of the thread is used.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and nanosecond.
// C#
public
OracleTimeStampTZ (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 OracleTimeStampTZ
(that is, the day is out of range for the month).
The time zone is set to the OracleGlobalization.TimeZone
of the thread.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, nanosecond, and time zone data.
// C#
public
OracleTimeStampTZ (int year, int month, int day, int hour, int minute,
int second, int nanosecond, string timeZone);
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).
timeZone
The time zone data provided.
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 OracleTimeStampTZ
(that is, the day is out of range for the month or the time zone is invalid).
timeZone
can be either an hour offset, for example, 7:00, or a valid time zone region name that is provided in V$TIMEZONE_NAMES
, such as US/Pacific. Time zone abbreviations are not supported.
If time zone is null, the OracleGlobalization.TimeZone
of the thread is used.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value to the provided byte array, that represents the internal Oracle TIMESTAMP
WITH
TIME
ZONE
format.
// C#
public
OracleTimeStampLTZ (byte[] bytes);
bytes
The provided byte array that represents an Oracle TIMESTAMP
WITH
TIME
ZONE
in Oracle internal format.
ArgumentException
- bytes
is not in internal Oracle TIMESTAMP
WITH
TIME
ZONE
format or bytes
is not a valid Oracle TIMESTAMP
WITH
TIME
ZONE
.
ArgumentNullException
- bytes
is null.
The OracleTimeStampTZ
static fields are listed in Table 5-120.
This static field represents the maximum valid datetime time for an OracleTimeStampTZ
structure in UTC, which is December 31, 999923:59:59.999999999.
// C# public static readonly OracleTimeStampTZ MaxValue;
This static field represents the minimum valid datetime for an OracleTimeStampTZ
structure in UTC, which is January 1, -4712 0:0:0.
// C# public static readonly OracleTimeStampTZ MinValue;
This static field represents a null value that can be assigned to an instance of the OracleTimeStampTZ
structure.
// C# public static readonly OracleTimeStampTZ Null;
The OracleTimeStampTZ
static methods are listed in Table 5-121.
This static method determines if two OracleTimeStampTZ
values are equal.
// C# public static bool Equals(OracleTimeStampTZ value1, OracleTimeStampTZ value2);
Returns true
if two OracleTimeStampTZ
values are equal. Returns false
otherwise.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
This static method gets an OracleTimeStampTZ
structure that represents the current date and time.
// C# public static OracleTimeStampTZ GetSysDate();
An OracleTimeStampTZ
structure that represents the current date and time.
This static method determines if the first of two OracleTimeStampTZ
values is greater than the second.
// C# public static bool GreaterThan(OracleTimeStampTZ value1, OracleTimeStampTZ value2);
Returns true
if the first of two OracleTimeStampTZ
values is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStampTZ
values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleTimeStampTZ value1, OracleTimeStampTZ value2);
Returns true
if the first of two OracleTimeStampTZ
values is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStampTZ
values is less than the second.
// C# public static bool LessThan(OracleTimeStampTZ value1, OracleTimeStampTZ value2);
Returns true
if the first of two OracleTimeStampTZ
values is less than the second. Returns false
otherwise.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStampTZ
values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleTimeStampTZ value1, OracleTimeStampTZ value2);
Returns true
if the first of two OracleTimeStampTZ
values is less than or equal to the second. Returns false
otherwise.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
This static method determines if two OracleTimeStampTZ
values are not equal.
// C# public static bool NotEquals(OracleTimeStampTZ value1, OracleTimeStampTZ value2);
Returns true
if two OracleTimeStampTZ
values are not equal. Returns false
otherwise.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
This static method returns an OracleTimeStampTZ
structure and sets its value for date and time using the supplied string.
// C# public static OracleTimeStampTZ Parse(string tsStr);
An OracleTimeStampTZ
structure.
ArgumentException
- The tsStr
is an invalid string representation of an Oracle TIMESTAMP
WITH
TIME
ZONE
or the tsStr
is not in the timestamp format specified by the OracleGlobalization
.TimeStampTZFormat
property of the thread, which represents Oracle's NLS_TIMESTAMP_TZ_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_tz_format for the Parse() method OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStampTZ from a string using the format specified. OracleTimeStampTZ tstz = OracleTimeStampTZ.Parse("11-NOV-1999 " + "11:02:33.444 AM US/Pacific"); // Set the nls_timestamp_tz_format for the ToString() method og.TimeStampTZFormat = "YYYY-MON-DD HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(tstz.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM US/Pacific"
This static method returns a new instance of an OracleTimeStampTZ
with the specified fractional second precision.
// C# public static OracleTimeStampTZ SetPrecision(OracleTimeStampTZ value1, int fracSecPrecision);
value1
The provided OracleTimeStampTZ
object.
fracSecPrecision
The fractional second precision provided. Range of fractional second precision is (0 to 9).
An OracleTimeStampTZ
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 OracleTimeStampTZ
value. Depending on this value, 0
or more trailing zeros are displayed in the string returned by ToString()
.
The OracleTimeStampTZ
with a value of "December 31,
9999
23:59:59.99
US/Pacific
" results in the string "December
31,
9999 23:59:59.99000
US/Pacific
" when SetPrecision()
is called with the fractional second precision set to 5
.
The OracleTimeStampTZ
static operators are listed in Table 5-122.
operator+
adds the supplied structure to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
This static operator adds the supplied OracleIntervalDS
to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
This static operator adds the supplied OracleIntervalYM
to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
This static operator adds the supplied TimeSpan
to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
This static operator adds the supplied OracleIntervalDS
to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
// C# public static operator +(OracleTimeStampTZ value1, OracleIntervalDS value2);
An OracleTimeStampTZ
.
If either parameter has a null value, the returned OracleTimeStampTZ
has a null value.
This static operator adds the supplied OracleIntervalYM
to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
// C# public static operator +(OracleTimeStampTZ value1, OracleIntervalYM value2);
An OracleTimeStampTZ
.
If either parameter has a null value, the returned OracleTimeStampTZ
has a null value.
This static operator adds the supplied TimeSpan
to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
// C# public static operator +(OracleTimeStampTZ value1, TimeSpan value2);
An OracleTimeStampTZ
.
If the OracleTimeStampTZ
instance has a null value, the returned OracleTimeStampTZ
has a null value.
This static operator determines if two OracleTimeStampTZ
values are equal.
// C# public static bool operator == (OracleTimeStampTZ value1, OracleTimeStampTZ value2);
Returns true
if they are equal; otherwise returns false
.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampTZ
values is greater than the second.
// C# public static bool operator > (OracleTimeStampTZ value1, OracleTimeStampTZ value2);
Returns true
if the first OracleTimeStampTZ
value is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampTZ
values is greater than or equal to the second.
// C# public static bool operator >= (OracleTimeStampTZ value1, OracleTimeStampTZ value2);
Returns true
if the first OracleTimeStampTZ
is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
This static operator determines if two OracleTimeStampTZ
values are not equal.
// C# public static bool operator != (OracleTimeStampTZ value1, OracleTimeStampTZ value2);
Returns true
if two OracleTimeStampTZ
values are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampTZ
values is less than the second.
// C# public static bool operator < (OracleTimeStampTZ value1, OracleTimeStampTZ value2);
Returns true
if the first OracleTimeStampTZ
is less than the second; otherwise returns false
.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampTZ
values is less than or equal to the second.
// C# public static bool operator <= (OracleTimeStampTZ value1, OracleTimeStampTZ value2);
Returns true
if the first OracleTimeStampTZ
is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
operator-
subtracts the supplied value, from the supplied OracleTimeStampTZ
value, and returns a new OracleTimeStampTZ
structure.
This static operator subtracts the supplied OracleIntervalDS
value, from the supplied OracleTimeStampTZ
value, and return a new OracleTimeStampTZ
structure.
This static operator subtracts the supplied OracleIntervalYM
value, from the supplied OracleTimeStampTZ
value, and returns a new OracleTimeStampTZ
structure.
This static operator subtracts the supplied TimeSpan
value, from the supplied OracleTimeStampTZ
value, and returns a new OracleTimeStampTZ
structure.
This static operator subtracts the supplied OracleIntervalDS
value, from the supplied OracleTimeStampTZ
value, and return a new OracleTimeStampTZ
structure.
// C# public static operator - (OracleTimeStampTZ value1, OracleIntervalDS value2);
An OracleTimeStampTZ
structure.
If either parameter has a null value, the returned OracleTimeStampTZ
has a null value.
This static operator subtracts the supplied OracleIntervalYM
value, from the supplied OracleTimeStampTZ
value, and returns a new OracleTimeStampTZ
structure.
// C# public static operator - (OracleTimeStampTZ value1, OracleIntervalYM value2);
An OracleTimeStampTZ
structure.
If either parameter has a null value, the returned OracleTimeStampTZ
has a null value.
This static operator subtracts the supplied TimeSpan
value, from the supplied OracleTimeStampTZ
value, and returns a new OracleTimeStampTZ
structure.
// C# public static operator - (OracleTimeStampTZ value1, TimeSpan value2);
An OracleTimeStampTZ
structure.
If the OracleTimeStampTZ
instance has a null value, the returned OracleTimeStampTZ
structure has a null value.
The OracleTimeStampTZ
static type conversions are listed in Table 5-123.
explicit operator OracleTimeStampTZ converts an instance value to an OracleTimeStampTZ
structure.
This static type conversion operator converts an OracleTimeStamp
value to an OracleTimeStampTZ
structure.
This static type conversion operator converts an OracleTimeStampLTZ
value to an OracleTimeStampTZ
structure.
This static type conversion operator converts the supplied string value to an OracleTimeStampTZ
structure.
This static type conversion operator converts an OracleTimeStamp
value to an OracleTimeStampTZ
structure.
// C# public static explicit operator OracleTimeStampTZ(OracleTimeStamp value1);
The returned OracleTimeStampTZ
contains the date and time from the OracleTimeStamp
and the time zone from the OracleGlobalization.TimeZone
of the thread.
The OracleGlobalization.TimeZone
of the thread is used to convert from an OracleTimeStamp
structure to an OracleTimeStampTZ
structure.
If the OracleTimeStamp
structure has a null value, the returned OracleTimeStampTZ
structure also has a null value.
This static type conversion operator converts an OracleTimeStampLTZ
value to an OracleTimeStampTZ
structure.
// C# public static explicit operator OracleTimeStampTZ(OracleTimeStampLTZ value1);
The returned OracleTimeStampTZ
contains the date and time from the OracleTimeStampLTZ
and the time zone from the OracleGlobalization.TimeZone
of the thread.
If the OracleTimeStampLTZ
structure has a null value, the returned OracleTimeStampTZ
structure also has a null value.
This static type conversion operator converts the supplied string value to an OracleTimeStampTZ
structure.
// C# public static explicit operator OracleTimeStampTZ(string tsStr);
A OracleTimeStampTZ
value.
ArgumentException
- The tsStr
is an invalid string representation of an Oracle TIMESTAMP
WITH
TIME
ZONE
. or the tsStr
is not in the timestamp format specified by the thread's OracleGlobalization
.TimeStampTZFormat
property, which represents Oracle's NLS_TIMESTAMP_TZ_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_tz_format for the explicit operator // OracleTimeStampTZ(string) OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStampTZ from a string using the format specified. OracleTimeStampTZ tstz = new OracleTimeStampTZ("11-NOV-1999" + "11:02:33.444 AM US/Pacific"); // Set the nls_timestamp_tz_format for the ToString() method og.TimeStampTZFormat = "YYYY-MON-DD HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(tstz.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM US/Pacific"
implicit operator OracleTimeStampTZ
converts a DateTime
structure to an OracleTimeStampTZ
structure.
This static type conversion operator converts an OracleDate
value to an OracleTimeStampTZ
structure.
This static type conversion operator converts a DateTime
structure to an OracleTimeStampTZ
structure.
This static type conversion operator converts an OracleDate
value to an OracleTimeStampTZ
structure.
// C# public static implicit operator OracleTimeStampTZ(OracleDate value1);
The returned OracleTimeStampTZ
contains the date and time from the OracleDate
and the time zone from the OracleGlobalization.TimeZone
of the thread.
The OracleGlobalization.TimeZone
of the thread is used to convert from an OracleDate
to an OracleTimeStampTZ
structure. If the OracleDate
structure has a null value, the returned OracleTimeStampTZ
structure also has a null value.
This static type conversion operator converts a DateTime
structure to an OracleTimeStampTZ
structure.
// C# public static implicit operator OracleTimeStampTZ (DateTime value1);
The returned OracleTimeStampTZ
contains the date and time from the DateTime
and the time zone from the OracleGlobalization.TimeZone
of the thread.
The OracleGlobalization.TimeZone
of the thread is used to convert from a DateTime
to an Oracle TimeStampTZ
structure.
This static type conversion operator converts an OracleTimeStampTZ
value to a DateTime
structure in the current time zone.
// C# public static explicit operator DateTime(OracleTimeStampTZ value1);
A DateTime
containing the date and time in the current instance, but with the time zone information in the current instance truncated.
OracleNullValueException
- The OracleTimeStampTZ
structure has a null value.
The precision of the OracleTimeStampTZ
value can be lost during the conversion, and the time zone information in the current instance is truncated
The OracleTimeStampTZ
properties are listed in Table 5-124.
This property returns an array of bytes that represents an Oracle TIMESTAMP
WITH
TIME
ZONE
in Oracle internal format.
// C# public byte[] BinData {get;}
The provided byte array that represents an Oracle TIMESTAMP
WITH
TIME
ZONE
in Oracle internal format.
OracleNullValueException
- The current instance has a null value.
This property specifies the day component of an OracleTimeStampTZ
in the current time zone.
// 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 OracleTimeStampTZ
in the current time zone.
// 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 OracleTimeStampTZ
in the current time zone.
// 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 OracleTimeStampTZ
in the current time zone.
// 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 OracleTimeStampTZ
in the current time zone
// 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 OracleTimeStampTZ
in the current time zone.
// 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 OracleTimeStampTZ
in the current time zone.
// 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 returns the time zone of the OracleTimeStampTZ
instance.
// C# public string TimeZone{get;}
A string that represents the time zone.
If no time zone is specified in the constructor, this property is set to the thread's OracleGlobalization
.TimeZone
by default
This property returns the date and time that is stored in the OracleTimeStampTZ
structure in the current time zone.
// C# public DateTime Value{get;}
A DateTime
in the current time zone.
OracleNullValueException
- The current instance has a null value.
This property sets the year component of an OracleTimeStampTZ
in the current time zone.
// 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 OracleTimeStampTZ
methods are listed in Table 5-125.
This method adds the supplied number of days to the current instance.
// C# public OracleTimeStampTZ AddDays(double days);
An OracleTimeStampTZ
.
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 OracleTimeStampTZ AddHours(double hours);
An OracleTimeStampTZ
.
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 OracleTimeStampTZ AddMilliseconds(double milliseconds);
milliseconds
The supplied number of milliseconds. Range is (-8.64 * 1016< milliseconds
< 8.64 * 1016).
An OracleTimeStampTZ
.
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 OracleTimeStampTZ AddMinutes(double minutes);
minutes
The supplied number of minutes. Range is (-1,440,000,000,000 < minutes
< 1,440,000,000,000).
An OracleTimeStampTZ
.
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 OracleTimeStampTZ AddMonths(long months);
An OracleTimeStampTZ
.
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 OracleTimeStampTZ AddNanoseconds(long nanoseconds);
An OracleTimeStampTZ
.
OracleNullValueException
- The current instance has a null value.
This method adds the supplied number of seconds to the current instance.
// C# public OracleTimeStampTZ AddSeconds(double seconds);
An OracleTimeStampTZ
.
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 OracleTimeStampTZ AddYears(int years);
An OracleTimeStampTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method compares the current OracleTimeStampTZ
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 OracleTimeStampTZ
instance value is less than that of obj
.
Zero: if the current OracleTimeStampTZ
instance and obj
values are equal.
Greater than zero: if the current OracleTimeStampTZ
instance value is greater than that of obj
.
IComparable
ArgumentException
- The obj
is not of type OracleTimeStampTZ
.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
s. For example, comparing an OracleTimeStampTZ
instance with an OracleBinary
instance is not allowed. When an OracleTimeStampTZ
is compared with a different type, an ArgumentException
is thrown.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
Overrides Object
This method determines whether an object has the same date and time as the current OracleTimeStampTZ
instance.
// C# public override bool Equals(object obj);
Returns true
if the obj
is of type OracleTimeStampTZ
and represents the same date and time; otherwise, returns false
.
The following rules apply to the behavior of this method.
OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
OracleTimeStampTZ
s that contain a null value are equal.
This method subtracts an OracleTimeStampTZ
value from the current instance and returns an OracleIntervalDS
that represents the time interval.
// C# public OracleIntervalDS GetDaysBetween(OracleTimeStampTZ value1);
An OraintervalDS
that represents the interval between two OracleTimeStampTZ
values.
If either the current instance or the parameter has a null value, the returned OracleIntervalDS
has a null value.
Overrides Object
This method returns a hash code for the OracleTimeStampTZ
instance.
// C# public override int GetHashCode();
A number that represents the hash code.
This method gets the time zone portion in hours and minutes of the current OracleTimeStampTZ
.
// C# public TimeSpan GetTimeZoneOffset();
A TimeSpan
.
OracleNullValueException
- The current instance has a null value.
This method subtracts an OracleTimeStampTZ
value from the current instance and returns an OracleIntervalYM
that represents the time interval.
// C# public OracleIntervalYM GetYearsBetween(OracleTimeStampTZ val);
An OracleIntervalYM
that represents the interval between two OracleTimeStampTZ
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 OracleTimeStampTZ
instance to local time.
// C# public OracleTimeStampLTZ ToLocalTime();
An OracleTimeStampLTZ
that contains the date and time, which is normalized to the client local time zone, in the current instance.
If the current instance has a null value, the returned OracleTimeStampLTZ
has a null value.
This method converts the current OracleTimeStampTZ
structure to an OracleDate
structure.
// C# public OracleDate ToOracleDate();
The returned OracleDate
contains the date and time in the current instance, but the time zone information in the current instance is truncated
The precision of the OracleTimeStampTZ
value can be lost during the conversion, and the time zone information in the current instance is truncated.
If the current instance has a null value, the value of the returned OracleDate
structure has a null value.
This method converts the current OracleTimeStampTZ
structure to an OracleTimeStampLTZ
structure.
// C# public OracleTimeStampLTZ ToOracleTimeStampLTZ();
The returned OracleTimeStampLTZ
structure contains the date and time, which is normalized to the client local time zone, 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 OracleTimeStampTZ
structure to an OracleTimeStamp
structure.
// C# public OracleTimeStamp ToOracleTimeStamp();
The returned OracleTimeStamp
contains the date and time in the current instance, but the time zone information is truncated.
If the value of the current instance has a null value, the value of the returned OracleTimeStamp
structure has a null value.
Overrides Object
This method converts the current OracleTimeStampTZ
structure to a string.
// C# public override string ToString();
A string
that represents the same date and time as the current OracleTimeStampTZ
structure.
The returned value is a string representation of an OracleTimeStampTZ
in the format specified by the OracleGlobalization
.TimeStampTZFormat
property of the thread. The names and abbreviations used for months and days are in the language specified by the OracleGlobalization
.DateLanguage
and the OracleGlobalization.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_tz_format for the TimeStampTZFormat(string) constructor OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStampTZ from a string using the format specified. OracleTimeStampTZ tstz = new OracleTimeStampTZ("11-NOV-1999" + "11:02:33.444 AM US/Pacific"); // Set the nls_timestamp_tz_format for the ToString() method og.TimeStampTZFormat = "YYYY-MON-DD HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(tstz.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM US/Pacific"
This method converts the current datetime to Coordinated Universal Time (UTC).
// C# public OracleTimeStampTZ ToUniversalTime();
An OracleTimeStampTZ
structure.
If the current instance has a null value, the value of the returned OracleTimeStampTZ
structure has a null value.
This section covers the ODP.NET Type exceptions.
|
Copyright © 2002 Oracle Corporation. All Rights Reserved. |
|