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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からSoapDateTime クラスを検索する場合は、下記のリンクをクリックしてください。

- SoapDateTime クラスのページへのリンク