I wanted to know how I can transform a DateTime into an ISO 8601 format but keep it in a DateTime type
I wanted to know how I can transform a DateTime into an ISO 8601 format but keep it in a DateTime type
This is a form of date representation. A DateTime
is a structure that tries to simulate a point in time (a date), as you will represent it the date is not work of this structure itself.
You can use .ToString("o")
to represent DateTime
in ISO 8601 format.
string dataFormatada = minhaData.ToString("o");