Description
Details about Problem
nanoFramework area: (C# code | Nuget packages| Documentation )
VS version: (2017 | 2019 )
VS extension version:
latest
Target :
All
Description
It should be possible to return an ISO8601 compliant datetime, which is important for IoT.
Detailed repro steps so we can see the same problem
Use a program with all "supported" types of DateTime.ToString()
Other suggested things
Workaround would be DateTime.ToString("yyyy-MM-ddTHH:mm:ss.fffZ")
Expected behaviour
Use of DateTime.ToString("o")
returns a date in the format yyyy-MM-ddTHH:mm:ss.fffffffK
or at least yyyy-MM-ddTHH:mm:ss.fffZ
see https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings#Roundtrip for more details.
Sample Project
Screenshot
A sample implementation in .Net Core 3.1 shows:
Additional context
Also FYI, we do not support millisecond resolution which we should. See https://docs.microsoft.com/en-us/dotnet/api/system.datetime.tostring?view=net-5.0
I've made an effort to fix the bug
https://github.com/nanoframework/CoreLibrary/blob/develop/nanoFramework.CoreLibrary/System/Globalization/DateTimeFormat.cs needs revisiting for latest improvements in the .Net framework (including tests)