Beispiel #1
0
 /// <summary>
 /// Converts a system time zone ID to an equivalent Windows time zone ID.
 ///
 /// For example, Windows time zone ID "Pacific Standard Time" is returned for input "America/Los_Angeles".
 /// </summary>
 /// <param name="id">A system time zone ID. </param>
 /// <returns>A Windows time zone ID.</returns>
 public static string GetWindowsId(string id)
 {
     return(NativeMethods.GetUnicodeString((ptr, length) =>
     {
         length = NativeMethods.ucal_getWindowsTimeZoneId(id, ptr, length, out ErrorCode errorCode);
         return new Tuple <ErrorCode, int>(errorCode, length);
     }));
 }