0

I am using Chilkat Email .net version to create eml but I am facing issues of timezone, Please find the below code.

// 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");

And my system timezone is (UTC) Dublin, Edinburgh, Lisbon, London.

How can I get the actual date (unclearDate var value) in eml file because each time I run the application and open mail in Thunderbird, time is 2 AM instead of 1 AM.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Haseena Parkar
  • 939
  • 2
  • 12
  • 28

1 Answers1

0

Try

email.EmailDate = unclearDate;

The EmailDate property stores date and time in UTC/GMT standard. The LocalDate property is used to get and set the local date and time. Since unclearDate is now in UTC, it might not be best to set the LocaDate

Rak
  • 26
  • 1