TimeZoneInfo.ConvertTime 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
시간을 특정 표준 시간대의 시간으로 변환합니다.
오버로드
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 따라 달라지는 것을 보여 줍니다. 또한 표준 시간대 조정은 ConvertTime 오전 2시에 원본 표준 시간대와 대상 표준 시간대 모두에서 발생하기 때문에 표준 시간대 조정을 고려합니다. 2010년 11월 7일.
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 속성 값 |
---|---|
destinationTimeZone 이 TimeZoneInfo.Utc인 경우 |
DateTimeKind.Utc |
destinationTimeZone 이 TimeZoneInfo.Local인 경우 |
DateTimeKind.Local |
다른 모든 날짜 및 시간 값 및 대상 표준 시간대입니다. | DateTimeKind.Unspecified |
매개 변수 값 dateTime
이 모호한 현지 시간인 경우 표준 시간으로 해석됩니다. 매개 변수가 dateTime
잘못된 현지 시간인 경우 이 메서드는 ArgumentException.
결과 변환 dateTime
이 날짜 및 시간 값보다 DateTime.MaxValueDateTime.MinValue 이전 또는 이후인 경우 이 메서드는 각각 반환 DateTime.MinValue 하거나 DateTime.MaxValue반환합니다.
및 메서드를 호출하여 UTC로 변환하거나 UTC에서 변환할 ConvertTimeFromUtc ConvertTimeToUtc 수도 있습니다.
추가 정보
적용 대상
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 을 미국 및 캐나다의 동부 표준 시간대에 있는 시간으로 변환합니다. 표준 시간대 조정은 ConvertTime 오전 2시에 원본 표준 시간대와 대상 표준 시간대 모두에서 발생하기 때문에 이 메서드가 표준 시간대 조정을 고려한다는 것을 보여 줍니다. 2010년 11월 7일.
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
조정 규칙을 적용합니다.
이 오버로드는 값을 첫 번째 매개 변수로 수락하여 DateTimeOffset 메서드의 ConvertTime 다른 오버로드와 다릅니다. 이는 날짜와 시간을 특정 표준 시간대의 날짜 및 시간이 아닌 UTC(협정 세계시)의 오프셋으로 식별합니다. 따라서 매개 변수는 dateTimeOffset
모호한 시간 또는 잘못된 시간을 나타낼 수 없습니다.
값을 대상 표준 시간대의 시간으로 변환할 dateTimeOffset
때 이 메서드는 대상 표준 시간대에 적용되는 조정 규칙을 고려합니다.
결과 변환 dateTimeOffset
이 날짜 및 시간 값보다 DateTimeOffset.MaxValueDateTimeOffset.MinValue 이전 또는 이후인 경우 이 메서드는 각각 반환 DateTimeOffset.MinValue 하거나 DateTimeOffset.MaxValue반환합니다.
추가 정보
적용 대상
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
매개 변수가 잘못된 시간인 경우(즉, 표준 시간대의 조정 규칙 때문에 존재하지 않는 시간을 나타냄)
예제
다음 예제에서는 이 메서드를 사용하여 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인 경우 | 을 throw합니다 ArgumentException. |
DateTimeKind.Local | 같음 .TimeZoneInfo.Local | dateTime 대상 표준 시간대의 시간으로 변환합니다. |
DateTimeKind.Local | Does not equal TimeZoneInfo.Local인 경우 | 을 throw합니다 ArgumentException. |
DateTimeKind.Unspecified | 임의의. | dateTime 대상 표준 시간대의 시간으로 변환합니다. |
또한 UTC(협정 세계시)와 메서드를 호출 ConvertTimeFromUtc ConvertTimeToUtc 하여 변환할 수도 있습니다.
Kind 반환 DateTime 된 값의 속성은 다음 표와 같이 설정됩니다.
조건 | 반환된 Kind 속성 값 |
---|---|
destinationTimeZone 인수가 TimeZoneInfo.Utc인 경우 |
DateTimeKind.Utc |
destinationTimeZone 인수가 TimeZoneInfo.Local인 경우 |
DateTimeKind.Local |
다른 모든 날짜 및 시간 값, 원본 표준 시간대 및 대상 표준 시간대입니다. | DateTimeKind.Unspecified |
매개 변수 값 dateTime
이 원본 표준 시간대의 모호한 시간인 경우 표준 시간으로 해석됩니다. 매개 변수가 dateTime
원본 표준 시간대의 잘못된 시간인 경우 이 메서드는 ArgumentException.
결과 변환 dateTime
이 날짜 및 시간 값보다 DateTime.MaxValueDateTime.MinValue 이전 또는 이후인 경우 이 메서드는 각각 반환 DateTime.MinValue 하거나 DateTime.MaxValue반환합니다.
인수의 dateTime
속성이 인수가 아닌 TimeZoneInfo.Local경우 DateTime.Kind 메서드는 DateTimeKind.Local 예외를 sourceTimeZone
throw합니다ArgumentException.ConvertTime(DateTime, TimeZoneInfo, TimeZoneInfo) 원본 표준 시간대가 현지 표준 시간대인지 유니버설 표준 시간대인지 확인하기 위해 메서드는 메서드와의 값 같음을 테스트하는 대신 참조 같음을 Equals(TimeZoneInfo) 테스트합니다. TimeZoneInfo 로컬 표준 시간대를 나타내고 메서드를 호출 FindSystemTimeZoneById 하여 검색되는 개체는 참조 같TimeZoneInfo.Local음이 없습니다. 또한 TimeZoneInfo 로컬 표준 시간대 또는 범용 표준 시간대를 나타내고 메서드에서 반환 GetSystemTimeZones 된 컬렉션을 반복하여 검색되는 개체는 참조 같 TimeZoneInfo.Local 음 또는 TimeZoneInfo.Utc같음이 없습니다. 또는 메서드를 호출할 ConvertTimeBySystemTimeZoneId(DateTime, String, String) 수 있습니다.