SoapYearMonth.Parse(String) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将指定的 String 转换为 SoapYearMonth 对象。
public:
static System::Runtime::Remoting::Metadata::W3cXsd2001::SoapYearMonth ^ Parse(System::String ^ value);
public static System.Runtime.Remoting.Metadata.W3cXsd2001.SoapYearMonth Parse (string value);
static member Parse : string -> System.Runtime.Remoting.Metadata.W3cXsd2001.SoapYearMonth
Public Shared Function Parse (value As String) As SoapYearMonth
参数
返回
从 value
获取的 SoapYearMonth 对象。
例外
value
不包含与任何识别的格式模式相对应的日期和时间。
示例
下面的代码示例演示如何使用此方法。 此代码示例是为 SoapYearMonth 类提供的一个更大示例的一部分。
// Parse an XSD gYearMonth to create a SoapYearMonth object.
// The timezone of this object is -08:00.
String^ xsdYearMonth = "2003-11-08:00";
SoapYearMonth^ yearMonth = SoapYearMonth::Parse( xsdYearMonth );
// Parse an XSD gYearMonth to create a SoapYearMonth object.
// The time zone of this object is -08:00.
string xsdYearMonth = "2003-11-08:00";
SoapYearMonth yearMonth = SoapYearMonth.Parse(xsdYearMonth);
注解
方法 Parse 能够分析各种格式的字符串。 可识别的字符串格式由以下格式模式组成。
格式模式 | 说明 | 示例 |
---|---|---|
yyyy | 采用 4 位数格式的年份。 | 1999, 1812 |
MM | 数字月份。 个位数月份有前导零。 | 11, 05 |
zzz | 与格林威治平均时间) (世界时坐标) 的完整时区偏移量 (小时和分钟。 一位数小时具有前导零。 | -07:00, 08:00 |
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈