TimeZoneInfo.ConvertTime メソッド

定義

時刻を特定のタイム ゾーンの時刻に変換します。

オーバーロード

ConvertTime(DateTime, TimeZoneInfo)

時刻を特定のタイム ゾーンの時刻に変換します。

ConvertTime(DateTimeOffset, TimeZoneInfo)

時刻を特定のタイム ゾーンの時刻に変換します。

ConvertTime(DateTime, TimeZoneInfo, TimeZoneInfo)

あるタイム ゾーンの時刻を別のタイム ゾーンの時刻に変換します。

ConvertTime(DateTime, TimeZoneInfo)

時刻を特定のタイム ゾーンの時刻に変換します。

public:
 static DateTime ConvertTime(DateTime dateTime, TimeZoneInfo ^ destinationTimeZone);
public static DateTime ConvertTime (DateTime dateTime, TimeZoneInfo destinationTimeZone);
static member ConvertTime : DateTime * TimeZoneInfo -> DateTime
Public Shared Function ConvertTime (dateTime As DateTime, destinationTimeZone As TimeZoneInfo) As DateTime

パラメーター

dateTime
DateTime

変換する日付と時刻。

destinationTimeZone
TimeZoneInfo

dateTime の変換先タイム ゾーン。

戻り値

変換先タイム ゾーンでの日付と時刻。

例外

dateTime パラメーターの値が無効な時刻を表しています。

destinationTimeZone パラメーターの値が null です。

次の例では、日付と時刻の値の配列を、米国とカナダの東部タイム ゾーンの時刻に変換します。 ソースタイム ゾーンがソース値のDateTimeプロパティにDateTime.Kind依存していることを示します。 また、2010 年 11 月 7 日午前 2 時にソース タイム ゾーンと宛先タイム ゾーンの両方でタイム ゾーン調整が行われるため、このメソッドではタイム ゾーン調整が考慮されることを示 ConvertTime しています。

using System;

public class Example
{
   public static void Main()
   {
      // Define times to be converted.
      DateTime[] times = { new DateTime(2010, 1, 1, 0, 1, 0), 
                           new DateTime(2010, 1, 1, 0, 1, 0, DateTimeKind.Utc), 
                           new DateTime(2010, 1, 1, 0, 1, 0, DateTimeKind.Local),                            
                           new DateTime(2010, 11, 6, 23, 30, 0),
                           new DateTime(2010, 11, 7, 2, 30, 0) };
                              
      // Retrieve the time zone for Eastern Standard Time (U.S. and Canada).
      TimeZoneInfo est; 
      try {
         est = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
      }
      catch (TimeZoneNotFoundException) {
         Console.WriteLine("Unable to retrieve the Eastern Standard time zone.");
         return;
      }
      catch (InvalidTimeZoneException) {
         Console.WriteLine("Unable to retrieve the Eastern Standard time zone.");
         return;
      }   

      // Display the current time zone name.
      Console.WriteLine("Local time zone: {0}\n", TimeZoneInfo.Local.DisplayName);
      
      // Convert each time in the array.
      foreach (DateTime timeToConvert in times)
      {
         DateTime targetTime = TimeZoneInfo.ConvertTime(timeToConvert, est);
         Console.WriteLine("Converted {0} {1} to {2}.", timeToConvert, 
                           timeToConvert.Kind, targetTime);
      }                        
   }
}
// The example displays the following output:
//    Local time zone: (GMT-08:00) Pacific Time (US & Canada)
//    
//    Converted 1/1/2010 12:01:00 AM Unspecified to 1/1/2010 3:01:00 AM.
//    Converted 1/1/2010 12:01:00 AM Utc to 12/31/2009 7:01:00 PM.
//    Converted 1/1/2010 12:01:00 AM Local to 1/1/2010 3:01:00 AM.
//    Converted 11/6/2010 11:30:00 PM Unspecified to 11/7/2010 1:30:00 AM.
//    Converted 11/7/2010 2:30:00 AM Unspecified to 11/7/2010 5:30:00 AM.
open System

// Define times to be converted.
let times = 
    [| DateTime(2010, 1, 1, 0, 1, 0)
       DateTime(2010, 1, 1, 0, 1, 0, DateTimeKind.Utc)
       DateTime(2010, 1, 1, 0, 1, 0, DateTimeKind.Local)
       DateTime(2010, 11, 6, 23, 30, 0)
       DateTime(2010, 11, 7, 2, 30, 0) |]
                        
// Retrieve the time zone for Eastern Standard Time (U.S. and Canada).
try
    let est = TimeZoneInfo.FindSystemTimeZoneById "Eastern Standard Time"

    // Display the current time zone name.
    printfn $"Local time zone: {TimeZoneInfo.Local.DisplayName}\n"

    // Convert each time in the array.
    for timeToConvert in times do
        let targetTime = TimeZoneInfo.ConvertTime(timeToConvert, est)
        printfn $"Converted {timeToConvert} {timeToConvert.Kind} to {targetTime}."
with
| :? TimeZoneNotFoundException ->
    printfn "Unable to retrieve the Eastern Standard time zone."
| :? InvalidTimeZoneException ->
    printfn "Unable to retrieve the Eastern Standard time zone."
// The example displays the following output:
//    Local time zone: (GMT-08:00) Pacific Time (US & Canada)
//    
//    Converted 1/1/2010 12:01:00 AM Unspecified to 1/1/2010 3:01:00 AM.
//    Converted 1/1/2010 12:01:00 AM Utc to 12/31/2009 7:01:00 PM.
//    Converted 1/1/2010 12:01:00 AM Local to 1/1/2010 3:01:00 AM.
//    Converted 11/6/2010 11:30:00 PM Unspecified to 11/7/2010 1:30:00 AM.
//    Converted 11/7/2010 2:30:00 AM Unspecified to 11/7/2010 5:30:00 AM.
Module Example
   Public Sub Main()
      ' Define times to be converted.
      Dim times() As Date = { #1/1/2010 12:01AM#, _
                              DateTime.SpecifyKind(#1/1/2010 12:01AM#, DateTimeKind.Utc), _
                              DateTime.SpecifyKind(#1/1/2010 12:01AM#, DateTimeKind.Local), _
                              #11/6/2010 11:30PM#, #11/7/2010 2:30AM# }
                              
      ' Retrieve the time zone for Eastern Standard Time (U.S. and Canada).
      Dim est As TimeZoneInfo 
      Try
         est = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")
      Catch e As TimeZoneNotFoundException
         Console.WriteLine("Unable to retrieve the Eastern Standard time zone.")
         Exit Sub
      Catch e As InvalidTimeZoneException
         Console.WriteLine("Unable to retrieve the Eastern Standard time zone.")
         Exit Sub
      End Try   

      ' Display the current time zone name.
      Console.WriteLine("Local time zone: {0}", TimeZoneInfo.Local.DisplayName)
      Console.WriteLine()
      
      ' Convert each time in the array.
      For Each timeToConvert As Date In times
         Dim targetTime As Date = TimeZoneInfo.ConvertTime(timeToConvert, est)
         Console.WriteLine("Converted {0} {1} to {2}.", timeToConvert, _
                           timeToConvert.Kind, targetTime)
      Next                        
   End Sub
End Module
' The example displays the following output:
'    Local time zone: (GMT-08:00) Pacific Time (US & Canada)
'    
'    Converted 1/1/2010 12:01:00 AM Unspecified to 1/1/2010 3:01:00 AM.
'    Converted 1/1/2010 12:01:00 AM Utc to 12/31/2009 7:01:00 PM.
'    Converted 1/1/2010 12:01:00 AM Local to 1/1/2010 3:01:00 AM.
'    Converted 11/6/2010 11:30:00 PM Unspecified to 11/7/2010 1:30:00 AM.
'    Converted 11/7/2010 2:30:00 AM Unspecified to 11/7/2010 5:30:00 AM.

注釈

変換を実行するときに、 メソッドは ConvertTime(DateTimeOffset, TimeZoneInfo) 、タイム ゾーンで有効な調整規則を destinationTimeZone 適用します。

メソッドのこのオーバーロードはConvertTime(DateTime, TimeZoneInfo)、次の表に示すように、パラメーターKindの プロパティのdateTime値からソース タイム ゾーンを決定します。

Kind プロパティの値 ソース タイム ゾーン メソッドの動作
DateTimeKind.Local Local ローカル時刻を の destinationTimeZone時刻に変換します。
DateTimeKind.Utc Utc 協定世界時 (UTC) を の時刻に destinationTimeZone変換します。
DateTimeKind.Unspecified が であると見な Localされます。 ローカル時刻を の destinationTimeZone時刻に変換します。

Kind返されるDateTime値の プロパティは、次の表に示すように設定されます。

条件 返される Kind プロパティの値
destinationTimeZoneTimeZoneInfo.Utc です。 DateTimeKind.Utc
destinationTimeZoneTimeZoneInfo.Local です。 DateTimeKind.Local
その他のすべての日付と時刻の値と宛先のタイム ゾーン。 DateTimeKind.Unspecified

パラメーターの dateTime 値があいまいな現地時刻である場合は、標準時として解釈されます。 パラメーターが dateTime 無効なローカル時刻の場合、このメソッドは を ArgumentExceptionスローします。

dateTime変換によって、 より前またはそれより後DateTime.MinValueDateTime.MaxValueの日付と時刻の値が返される場合、このメソッドはそれぞれ または DateTime.MaxValueを返DateTime.MinValueします。

メソッドと ConvertTimeToUtc メソッドを呼び出ConvertTimeFromUtcすことで、UTC との間で変換することもできます。

こちらもご覧ください

適用対象

ConvertTime(DateTimeOffset, TimeZoneInfo)

時刻を特定のタイム ゾーンの時刻に変換します。

public:
 static DateTimeOffset ConvertTime(DateTimeOffset dateTimeOffset, TimeZoneInfo ^ destinationTimeZone);
public static DateTimeOffset ConvertTime (DateTimeOffset dateTimeOffset, TimeZoneInfo destinationTimeZone);
static member ConvertTime : DateTimeOffset * TimeZoneInfo -> DateTimeOffset
Public Shared Function ConvertTime (dateTimeOffset As DateTimeOffset, destinationTimeZone As TimeZoneInfo) As DateTimeOffset

パラメーター

dateTimeOffset
DateTimeOffset

変換する日付と時刻。

destinationTimeZone
TimeZoneInfo

dateTime の変換先タイム ゾーン。

戻り値

変換先タイム ゾーンでの日付と時刻。

例外

destinationTimeZone パラメーターの値が null です。

次の例では、値の DateTimeOffset 配列を米国とカナダの東部タイム ゾーンの時刻に変換します。 これは、2010 年 11 月 7 日午前 2 時にソース タイム ゾーンと宛先タイム ゾーンの両方でタイム ゾーン調整が行われるため、このメソッドがタイム ゾーン調整を考慮していることを示しています ConvertTime

using System;

public class Example
{
   public static void Main()
   {
      // Define times to be converted.
      DateTime time1 = new DateTime(2010, 1, 1, 12, 1, 0);
      DateTime time2 = new DateTime(2010, 11, 6, 23, 30, 0);
      DateTimeOffset[] times = { new DateTimeOffset(time1, TimeZoneInfo.Local.GetUtcOffset(time1)),
                                 new DateTimeOffset(time1, TimeSpan.Zero),
                                 new DateTimeOffset(time2, TimeZoneInfo.Local.GetUtcOffset(time2)),
                                 new DateTimeOffset(time2.AddHours(3), TimeZoneInfo.Local.GetUtcOffset(time2.AddHours(3))) };
                              
      // Retrieve the time zone for Eastern Standard Time (U.S. and Canada).
      TimeZoneInfo est; 
      try {
         est = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
      }
      catch (TimeZoneNotFoundException) {
         Console.WriteLine("Unable to retrieve the Eastern Standard time zone.");
         return;
      }
      catch (InvalidTimeZoneException) {
         Console.WriteLine("Unable to retrieve the Eastern Standard time zone.");
         return;
      }   

      // Display the current time zone name.
      Console.WriteLine("Local time zone: {0}\n", TimeZoneInfo.Local.DisplayName);
      
      // Convert each time in the array.
      foreach (DateTimeOffset timeToConvert in times)
      {
         DateTimeOffset targetTime = TimeZoneInfo.ConvertTime(timeToConvert, est);
         Console.WriteLine("Converted {0} to {1}.", timeToConvert, targetTime);
      }                        
   }
}
// The example displays the following output:
//    Local time zone: (GMT-08:00) Pacific Time (US & Canada)
//    
//    Converted 1/1/2010 12:01:00 AM -08:00 to 1/1/2010 3:01:00 AM -05:00.
//    Converted 1/1/2010 12:01:00 AM +00:00 to 12/31/2009 7:01:00 PM -05:00.
//    Converted 11/6/2010 11:30:00 PM -07:00 to 11/7/2010 1:30:00 AM -05:00.
//    Converted 11/7/2010 2:30:00 AM -08:00 to 11/7/2010 5:30:00 AM -05:00.
open System

// Define times to be converted.
let time1 = DateTime(2010, 1, 1, 12, 1, 0)
let time2 = DateTime(2010, 11, 6, 23, 30, 0)
let times = 
    [| DateTimeOffset(time1, TimeZoneInfo.Local.GetUtcOffset time1)
       DateTimeOffset(time1, TimeSpan.Zero)
       DateTimeOffset(time2, TimeZoneInfo.Local.GetUtcOffset time2)
       DateTimeOffset(time2.AddHours 3, TimeZoneInfo.Local.GetUtcOffset(time2.AddHours 3)) |]
                        
// Retrieve the time zone for Eastern Standard Time (U.S. and Canada).
try
    let est = TimeZoneInfo.FindSystemTimeZoneById "Eastern Standard Time"

    // Display the current time zone name.
    printfn $"Local time zone: {TimeZoneInfo.Local.DisplayName}\n"

    // Convert each time in the array.
    for timeToConvert in times do
        let targetTime = TimeZoneInfo.ConvertTime(timeToConvert, est)
        printfn $"Converted {timeToConvert} to {targetTime}."
with
| :? TimeZoneNotFoundException ->
    printfn "Unable to retrieve the Eastern Standard time zone."
| :? InvalidTimeZoneException ->
    printfn "Unable to retrieve the Eastern Standard time zone."
// The example displays the following output:
//    Local time zone: (GMT-08:00) Pacific Time (US & Canada)
//    
//    Converted 1/1/2010 12:01:00 AM -08:00 to 1/1/2010 3:01:00 AM -05:00.
//    Converted 1/1/2010 12:01:00 AM +00:00 to 12/31/2009 7:01:00 PM -05:00.
//    Converted 11/6/2010 11:30:00 PM -07:00 to 11/7/2010 1:30:00 AM -05:00.
//    Converted 11/7/2010 2:30:00 AM -08:00 to 11/7/2010 5:30:00 AM -05:00.
Module Example
   Public Sub Main()
      ' Define times to be converted.
      Dim time1 As Date = #1/1/2010 12:01AM#
      Dim time2 As Date = #11/6/2010 11:30PM#
      Dim times() As DateTimeOffset = { New DateTimeOffset(time1, TimeZoneInfo.Local.GetUtcOffset(time1)), _
                                        New DateTimeOffset(time1, Timespan.Zero), _
                                        New DateTimeOffset(time2, TimeZoneInfo.Local.GetUtcOffset(time2)), _
                                        New DateTimeOffset(time2.AddHours(3), TimeZoneInfo.Local.GetUtcOffset(time2.AddHours(3))) }
                              
      ' Retrieve the time zone for Eastern Standard Time (U.S. and Canada).
      Dim est As TimeZoneInfo 
      Try
         est = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")
      Catch e As TimeZoneNotFoundException
         Console.WriteLine("Unable to retrieve the Eastern Standard time zone.")
         Exit Sub
      Catch e As InvalidTimeZoneException
         Console.WriteLine("Unable to retrieve the Eastern Standard time zone.")
         Exit Sub
      End Try   

      ' Display the current time zone name.
      Console.WriteLine("Local time zone: {0}", TimeZoneInfo.Local.DisplayName)
      Console.WriteLine()
      
      ' Convert each time in the array.
      For Each timeToConvert As DateTimeOffset In times
         Dim targetTime As DateTimeOffset = TimeZoneInfo.ConvertTime(timeToConvert, est)
         Console.WriteLine("Converted {0} to {1}.", timeToConvert, targetTime)
      Next                        
   End Sub
End Module
' The example displays the following output:
'    Local time zone: (GMT-08:00) Pacific Time (US & Canada)
'    
'    Converted 1/1/2010 12:01:00 AM -08:00 to 1/1/2010 3:01:00 AM -05:00.
'    Converted 1/1/2010 12:01:00 AM +00:00 to 12/31/2009 7:01:00 PM -05:00.
'    Converted 11/6/2010 11:30:00 PM -07:00 to 11/7/2010 1:30:00 AM -05:00.
'    Converted 11/7/2010 2:30:00 AM -08:00 to 11/7/2010 5:30:00 AM -05:00.

注釈

変換を実行するときに、 メソッドは ConvertTime(DateTimeOffset, TimeZoneInfo) 、タイム ゾーンで有効な調整規則を destinationTimeZone 適用します。

このオーバーロードは、最初のパラメーターとして値を ConvertTime 受け入れることで、メソッドの他の DateTimeOffset オーバーロードとは異なります。 これにより、日付と時刻は、特定のタイム ゾーンの日付と時刻としてではなく、協定世界時 (UTC) からのオフセットとして識別されます。 その結果、パラメーターは dateTimeOffset あいまいな時刻または無効な時刻を表すことができません。

このメソッドは、値を dateTimeOffset 宛先タイム ゾーンの時刻に変換する際に、宛先タイム ゾーンで有効な調整規則を考慮します。

dateTimeOffset変換によって、 より前またはそれより後DateTimeOffset.MinValueDateTimeOffset.MaxValueの日付と時刻の値が返される場合、このメソッドはそれぞれ または DateTimeOffset.MaxValueを返DateTimeOffset.MinValueします。

こちらもご覧ください

適用対象

ConvertTime(DateTime, TimeZoneInfo, TimeZoneInfo)

あるタイム ゾーンの時刻を別のタイム ゾーンの時刻に変換します。

public:
 static DateTime ConvertTime(DateTime dateTime, TimeZoneInfo ^ sourceTimeZone, TimeZoneInfo ^ destinationTimeZone);
public static DateTime ConvertTime (DateTime dateTime, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone);
static member ConvertTime : DateTime * TimeZoneInfo * TimeZoneInfo -> DateTime
Public Shared Function ConvertTime (dateTime As DateTime, sourceTimeZone As TimeZoneInfo, destinationTimeZone As TimeZoneInfo) As DateTime

パラメーター

dateTime
DateTime

変換する日付と時刻。

sourceTimeZone
TimeZoneInfo

dateTime のタイム ゾーン。

destinationTimeZone
TimeZoneInfo

dateTime の変換先タイム ゾーン。

戻り値

変換元タイム ゾーンでの dateTime パラメーターに対応する、変換先タイム ゾーンでの日付と時刻。

例外

dateTime パラメーターの Kind プロパティは Local ですが、sourceTimeZone パラメーターが Local と等しくありません。

- または -

dateTime パラメーターの Kind プロパティは Utc ですが、sourceTimeZone パラメーターが Utc と等しくありません。

- または -

dateTime パラメーターが無効な時刻です (つまり、タイム ゾーンの調整規則が原因で、存在しない時刻を表しています)。

sourceTimeZone パラメーターが null です。

または

destinationTimeZone パラメーターが null です。

次の例は、 メソッドを使用 ConvertTime(DateTime, TimeZoneInfo, TimeZoneInfo) してハワイ標準時から現地時刻に変換する方法を示しています。

DateTime hwTime = new DateTime(2007, 02, 01, 08, 00, 00);
try
{
   TimeZoneInfo hwZone = TimeZoneInfo.FindSystemTimeZoneById("Hawaiian Standard Time");
   Console.WriteLine("{0} {1} is {2} local time.", 
           hwTime, 
           hwZone.IsDaylightSavingTime(hwTime) ? hwZone.DaylightName : hwZone.StandardName, 
           TimeZoneInfo.ConvertTime(hwTime, hwZone, TimeZoneInfo.Local));
}
catch (TimeZoneNotFoundException)
{
   Console.WriteLine("The registry does not define the Hawaiian Standard Time zone.");
}                           
catch (InvalidTimeZoneException)
{
   Console.WriteLine("Registry data on the Hawaiian Standard Time zone has been corrupted.");
}
let hwTime = DateTime(2007, 02, 01, 08, 00, 00)
try
    let hwZone = TimeZoneInfo.FindSystemTimeZoneById "Hawaiian Standard Time"
    printfn $"{hwTime} {if hwZone.IsDaylightSavingTime hwTime then hwZone.DaylightName else hwZone.StandardName} is {TimeZoneInfo.ConvertTime(hwTime, hwZone, TimeZoneInfo.Local)} local time." 
with
| :? TimeZoneNotFoundException ->
    printfn "The registry does not define the Hawaiian Standard Time zone."
| :? InvalidTimeZoneException ->
    printfn "Registry data on the Hawaiian Standard Time zone has been corrupted."
Dim hwTime As Date = #2/01/2007 8:00:00 AM#
Try
   Dim hwZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Hawaiian Standard Time")
   Console.WriteLine("{0} {1} is {2} local time.", _
                     hwTime, _
                     IIf(hwZone.IsDaylightSavingTime(hwTime), hwZone.DaylightName, hwZone.StandardName), _
                     TimeZoneInfo.ConvertTime(hwTime, hwZone, TimeZoneInfo.Local))
Catch e As TimeZoneNotFoundException
   Console.WriteLine("The registry does not define the Hawaiian Standard Time zone.")
Catch e As InvalidTimeZoneException
   Console.WriteLine("Registry data on the Hawaiian Standard Time zone has been corrupted.")
End Try

注釈

変換を実行するときに、 メソッドは ConvertTime 、タイム ゾーンで有効な調整規則を destinationTimeZone 適用します。

パラメーターの プロパティの Kind 値は、次の dateTime 表に示すように、 パラメーターに sourceTimeZone 対応している必要があります。

DateTime.Kind 値 sourceTimeZone 値 メソッドの動作
DateTimeKind.Utc TimeZoneInfo.Utc等しくなります。 変換先のタイム ゾーンの時刻に変換 dateTime します。
DateTimeKind.Utc Does not equal TimeZoneInfo.Utcです。 をスローします ArgumentException
DateTimeKind.Local TimeZoneInfo.Local等しくなります。 変換先のタイム ゾーンの時刻に変換 dateTime します。
DateTimeKind.Local Does not equal TimeZoneInfo.Localです。 をスローします ArgumentException
DateTimeKind.Unspecified 任意。 変換先のタイム ゾーンの時刻に変換 dateTime します。

および メソッドを呼び出ConvertTimeFromUtcConvertTimeToUtcして、協定世界時 (UTC) との間で変換することもできます。

Kind返されるDateTime値の プロパティは、次の表に示すように設定されます。

条件 返される Kind プロパティの値
destinationTimeZone 引数が TimeZoneInfo.Utc です。 DateTimeKind.Utc
destinationTimeZone 引数が TimeZoneInfo.Local です。 DateTimeKind.Local
その他のすべての日付と時刻の値、ソース タイム ゾーン、および宛先タイム ゾーン。 DateTimeKind.Unspecified

パラメーターの dateTime 値がソース タイム ゾーンのあいまいな時刻である場合、標準時刻として解釈されます。 パラメーターが dateTime ソース タイム ゾーンの無効な時刻である場合、このメソッドは を ArgumentExceptionスローします。

dateTime変換によって、 より前またはそれより後DateTime.MinValueDateTime.MaxValueの日付と時刻の値が返される場合、このメソッドはそれぞれ または DateTime.MaxValueを返DateTime.MinValueします。

ConvertTime(DateTime, TimeZoneInfo, TimeZoneInfo)引数の ArgumentException プロパティが で、引数が ではないTimeZoneInfo.Local場合DateTime.KinddateTimeメソッドはDateTimeKind.Local例外をsourceTimeZoneスローします。 ソース タイム ゾーンがローカル タイム ゾーンかユニバーサル タイム ゾーンかを判断するために、 メソッドを使用して値の等価性をテストする代わりに、参照の等価性を Equals(TimeZoneInfo) テストします。 TimeZoneInfoローカル タイム ゾーンを表し、 メソッドを呼び出FindSystemTimeZoneByIdして取得される オブジェクトは、 とのTimeZoneInfo.Local参照等価性を持たないことに注意してください。 さらに、TimeZoneInfoローカルタイム ゾーンまたはユニバーサル タイム ゾーンを表し、 メソッドによってGetSystemTimeZones返されるコレクションを反復処理して取得される オブジェクトは、 または TimeZoneInfo.Utcと参照の等価性TimeZoneInfo.Localを持っていません。 別の方法として、 メソッドを ConvertTimeBySystemTimeZoneId(DateTime, String, String) 呼び出すことができます。

こちらもご覧ください

適用対象