本文整理汇总了VB.NET中System.TimeZoneInfo.ConvertTimeFromUtc方法的典型用法代码示例。如果您正苦于以下问题:VB.NET TimeZoneInfo.ConvertTimeFromUtc方法的具体用法?VB.NET TimeZoneInfo.ConvertTimeFromUtc怎么用?VB.NET TimeZoneInfo.ConvertTimeFromUtc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了TimeZoneInfo.ConvertTimeFromUtc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: IIf
Dim timeUtc As Date = Date.UtcNow
Try
Dim cstZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time")
Dim cstTime As Date = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, cstZone)
Console.WriteLine("The date and time are {0} {1}.", _
cstTime, _
IIf(cstZone.IsDaylightSavingTime(cstTime), _
cstZone.DaylightName, cstZone.StandardName))
Catch e As TimeZoneNotFoundException
Console.WriteLine("The registry does not define the Central Standard Time zone.")
Catch e As InvalidTimeZoneException
Console.WriteLine("Registry data on the Central Standard Time zone has been corrupted.")
End Try