0

Chilkat Email .net バージョンを使用して eml を作成していますが、タイムゾーンの問題に直面しています。以下のコードを見つけてください

    // Get the DaylightTime object for the current year.
    unclearDate = new DateTime(1999, 3, 28, 01, 00, 00);

    DaylightTime daylight =
    localZone.GetDaylightChanges(currentYear);

    var dateTimeOffset =
    new DateTimeOffset(unclearDate, daylight.Delta);

    unclearDate =  dateTimeOffset.UtcDateTime;

    Chilkat.Email email = new Chilkat.Email();
    email.Subject = "test date";

    email.LocalDate = unclearDate;
    email.SaveEml(@"C:\temp\eml1.eml");

私のシステムのタイムゾーンは (UTC) ダブリン、エジンバラ、リスボン、ロンドンです

アプリケーションを実行して Thunderbird でメールを開くたびに、時刻が午前 1 時ではなく午前 2 時になるため、eml ファイルで実際の日付 (unclearDate var 値) を取得するにはどうすればよいですか。

よろしくお願いします、 ハセナ

4

1 に答える 1

0

試す

email.EmailDate = unclearDate;

EmailDate プロパティは、日付と時刻を UTC/GMT 標準で格納します。LocalDate プロパティは、ローカルの日付と時刻を取得および設定するために使用されます。unknownDate は現在 UTC であるため、LocaDate を設定するのは最適ではない可能性があります

于 2013-02-15T14:39:48.797 に答える