Is there an existing issue for this?
Describe the bug
Hello,
I have the following model that is used as input of a controller method:
public class TestController : ControllerBase
{
[HttpPost]
public DateTimeOffset Post([FromForm] InputModel model)
{
return model.StartDate;
}
}
public class InputModel
{
public DateTimeOffset StartDate { get; set; }
}
When I sent the string '2022-11-29 10:00' in NET6, the local timezone offset (+1 in my case) is used for the DateTimeOffset. However, in NET7, the offset is always 0.
Expected Behavior
I expect the datetimeoffset is parsed with the local timezone offset, if none is provided in the input string.
Steps To Reproduce
https://github.com/yannicsmeets/datetimeoffset-demo
The main branch is net6. In the net7 branch, the target framework is set to net7.0
Exceptions (if any)
No response
.NET Version
7.0.100
Anything else?
No response
Is there an existing issue for this?
Describe the bug
Hello,
I have the following model that is used as input of a controller method:
When I sent the string '2022-11-29 10:00' in NET6, the local timezone offset (+1 in my case) is used for the DateTimeOffset. However, in NET7, the offset is always 0.
Expected Behavior
I expect the datetimeoffset is parsed with the local timezone offset, if none is provided in the input string.
Steps To Reproduce
https://github.com/yannicsmeets/datetimeoffset-demo
The main branch is net6. In the net7 branch, the target framework is set to net7.0
Exceptions (if any)
No response
.NET Version
7.0.100
Anything else?
No response