explicit operator OracleTimeStampTZ(string)
この静的型変換演算子は、指定された文字列の値をOracleTimeStampTZ
構造に変換します。
宣言
// C#
public static explicit operator OracleTimeStampTZ(string tsStr);
パラメータ
-
tsStr
Oracleの
TIMESTAMP
WITH
TIME
ZONE
を表す文字列
戻り値
OracleTimeStampTZ
値。
例外
ArgumentException
- tsStr
がOracleのTIMESTAMP
WITH
TIME
ZONE
を表す文字列として無効であるか、tsStr
がOracle NLS_TIMESTAMP_TZ_FORMAT
パラメータを表すスレッドのOracleGlobalization
.TimeStampTZFormat
プロパティによって指定されたタイムスタンプ書式ではありません。
備考
月および日付に使用されている名称および略称は、スレッドのOracleGlobalization
オブジェクトのDateLanguage
およびCalendar
プロパティで指定されている言語による表記です。スレッドのグローバリゼーション・プロパティのいずれかがNULLまたは空の文字列に設定されている場合、クライアントのコンピュータの設定が使用されます。
例
// C# using System; using Oracle.DataAccess.Client; using Oracle.DataAccess.Types; class OracleTimeStampTZSample { static void Main() { // Set the nls_timestamp_tz_format for the explicit operator // OracleTimeStampTZ(string) OracleGlobalization info = OracleGlobalization.GetClientInfo(); info.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(info); // 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 info.TimeStampTZFormat = "YYYY-MON-DD HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(info); Console.WriteLine(tstz.ToString()); } }