DateTime Timezone Issues
See original GitHub issueAfter updating from a very old version, I noticed a change with DateTime mapping. Even with a DateTime converter that changes the Kind of DateTime, something in AutoMapper changes it to UTC time. So for example, let’s say I want the DateTime to be specified as Local time like this:
public class DateTimeAutoMapperResolver : AutoMapper.ITypeConverter<DateTime, DateTime>
{
public DateTime Convert(DateTime source, DateTime destination, ResolutionContext context)
{
destination = DateTime.SpecifyKind(new DateTime(source.Ticks), DateTimeKind.Local);
return destination;
}
}
Even with this, the dates come back converted to UTC time. I cannot find a setting to stop it from doing this. I do not want AutoMapper to modify DateTimes.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Datetime timezone conversion issue in Typescript
I have picked a date from matDatePIcker in angular and passed that to the cloud application. But the DateTime is then converted based...
Read more >Timezone issues when storing datetime attributes.
I'm having an issue with storing and retrieving date time fields. This probably has something to do with the new Laravel 7 date...
Read more >Sharepoint DateTime Timezone Issues
Hi! I'm having an issue with a SharePoint list that uses datetime across different time zones. This column is really only needed for...
Read more >A DateTime and time zone issue that may surprise you
I was working with a third-party API, and had to specify a date range object, with a start and date. The problem was,...
Read more >Working with dates and timezones in JavaScript: a survival ...
A helpful primer for working with dates and timezones in Javascript. ... Nor are date and timezone problems the sort of issue that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t see it.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.