【问题标题】:Chilkat EML Daylight Saving time issueChilkat EML 夏令时问题
【发布时间】:2013-01-30 05:57:39
【问题描述】:

我正在使用 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) Dublin, Edinburgh, Lisbon, London

我如何在 eml 文件中获取实际日期(unclearDate var 值),因为每次我运行应用程序并在 Thunderbird 中打开邮件时,时间都是凌晨 2 点而不是凌晨 1 点。

感谢和问候, 哈西娜

【问题讨论】:

  • Chilkat 支持人员怎么说?

标签: c# timezone chilkat


【解决方案1】:

试试

email.EmailDate = unclearDate;

EmailDate 属性以 UTC/GMT 标准存储日期和时间。 LocalDate 属性用于获取和设置本地日期和时间。由于 clearDate 现在是 UTC,所以最好不要设置 LocaDate

【讨论】:

  • 导致同样的问题:(
猜你喜欢
  • 2017-03-14
  • 2013-11-15
  • 2015-06-07
  • 2011-11-20
  • 2011-11-20
  • 2013-02-19
  • 2010-10-12
  • 2013-08-28
  • 2014-08-22
相关资源
最近更新 更多