SoapDateTime クラス
アセンブリ: mscorlib (mscorlib.dll 内)
構文
解説
XSD データ型の詳細については、MSDN ライブラリ (http://msdn.microsoft.com/library) の「XML Data Types Reference」を参照してください。
SoapDateTime クラスのメソッドを使用して、DateTime オブジェクトと XSD dateTime 文字列間の変換を行う方法を次のコード例に示します。
using System; using System.Runtime.Remoting.Metadata.W3cXsd2001; public class Demo { public static void Main(string[] args) { // Parse an XSD dateTime to create a DateTime object. string xsdDateTime = "2003-02-04T13:58:59.9999999+03:00"; DateTime dateTime = SoapDateTime.Parse(xsdDateTime); // Serialize a DateTime object as an XSD dateTime string. Console.WriteLine("The date in XSD format is {0}." , SoapDateTime.ToString(dateTime)); // Print the XSD type string of the SoapDateTime class. Console.WriteLine("The XSD type of SoapDateTime is {0}.", SoapDateTime.XsdType); } }
using namespace System; using namespace System::Runtime::Remoting::Metadata::W3cXsd2001; int main() { // Parse an XSD dateTime to create a DateTime object. String^ xsdDateTime = "2003-02-04T13:58:59.9999999+03:00"; DateTime dateTime = SoapDateTime::Parse( xsdDateTime ); // Serialize a DateTime object as an XSD dateTime string. Console::WriteLine( "The date in XSD format is {0}.", SoapDateTime::ToString( dateTime ) ); // Print out the XSD type string of the SoapDateTime class. Console::WriteLine( "The XSD type of SoapDateTime is {0}.", SoapDateTime::XsdType ); }
import System.*; import System.Runtime.Remoting.Metadata.W3cXsd2001.*; public class Demo { public static void main(String[] args) { // Parse an XSD dateTime to create a DateTime object. String xsdDateTime = "2003-02-04T13:58:59.9999999+03:00"; DateTime dateTime = SoapDateTime.Parse(xsdDateTime); // Serialize a DateTime object as an XSD dateTime string. Console.WriteLine("The date in XSD format is {0}." , SoapDateTime.ToString(dateTime)); // Print the XSD type string of the SoapDateTime class. Console.WriteLine("The XSD type of SoapDateTime is {0}.", System.Convert.ToString(SoapDateTime.get_XsdType())); } //main } //Demo
System.Runtime.Remoting.Metadata.W3cXsd2001.SoapDateTime
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
SoapDateTime コンストラクタ
アセンブリ: mscorlib (mscorlib.dll 内)
構文
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
SoapDateTime プロパティ
SoapDateTime メソッド
パブリック メソッド
名前 | 説明 | |
---|---|---|
Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) | |
GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) | |
GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) | |
Parse | 指定した String を DateTime オブジェクトに変換します。 | |
ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) | |
ToString | オーバーロードされます。 現在のオブジェクトを表す文字列を返します。 |
SoapDateTime メンバ
DateTime を XSD dateTime に従って書式設定した文字列にシリアル化および逆シリアル化するための静的メソッドを提供します。
SoapDateTime データ型で公開されるメンバを以下の表に示します。
パブリック コンストラクタ
名前 | 説明 | |
---|---|---|
SoapDateTime |
パブリック メソッド
名前 | 説明 | |
---|---|---|
Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) | |
GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) | |
GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) | |
Parse | 指定した String を DateTime オブジェクトに変換します。 | |
ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) | |
ToString | オーバーロードされます。 現在のオブジェクトを表す文字列を返します。 |
- SoapDateTimeのページへのリンク