This constructor creates a new instance of the OracleTimeStamp structure and sets its value using the supplied string.


// C#
public OracleTimeStamp (string tsStr);


  • tsStr

    A string that represents an Oracle TIMESTAMP.


ArgumentException - The tsStr value is an invalid string representation of an Oracle TIMESTAMP or the supplied tsStr is not in the timestamp format specified by the OracleGlobalization.TimeStampFormat property of the thread, which represents 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 OracleTimeStampSample
  static void Main()
    // Set the nls_timestamp_format for the OracleTimeStamp(string) 
    // constructor
    OracleGlobalization info = OracleGlobalization.GetClientInfo();
    info.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM";
    // construct OracleTimeStamp from a string using the format specified.
    OracleTimeStamp ts = new OracleTimeStamp("11-NOV-1999 11:02:33.444 AM");
    // Set the nls_timestamp_format for the ToString() method
    info.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM";
    // Prints "1999-NOV-11 11:02:33.444000000 AM"