プライマリ・コンテンツに移動
Oracle® Data Provider for .NET開発者ガイド
ODAC 12.2c リリース1 (12.2.0.1) for Microsoft Windows
E88311-03
目次へ移動
目次
索引へ移動
索引

前
次

OracleTimeStampTZ(string)

このコンストラクタはOracleTimeStampTZ構造の新規インスタンスを作成し、指定された文字列を使用して日付および時間の値を設定します。

宣言

// C#
public OracleTimeStampTZ (string tsStr);

パラメータ

  • tsStr

    OracleのTIMESTAMP WITH TIME ZONEを表す文字列

例外

ArgumentException - tsStrがOracleのTIMESTAMP WITH TIME ZONEを表す文字列として無効であるか、tsStrがスレッドのOracleGlobalization.TimeStampTZFormatプロパティによって指定されたタイムスタンプ書式ではありません。

ArgumentNullException - tsStr値はNULLです。

備考

月および日付に使用されている名称および略称は、スレッドのOracleGlobalizationオブジェクトのDateLanguageおよびCalendarプロパティで指定されている言語による表記です。スレッドのグローバリゼーション・プロパティのいずれかがNULLまたは空の文字列に設定されている場合、クライアントのコンピュータの設定が使用されます。

// C#
 
using System;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
 
class OracleTimeStampTZSample
{
  static void Main()
  {
    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);
 
    // Prints "1999-NOV-11 11:02:33.444000000 AM US/Pacific"
    Console.WriteLine(tstz.ToString());    
  }
}