Reputation: 162
I need to set expire date of product as present date till midnight as shown below in UTC format.
"2021-05-28T23:59:59Z"
How i can write this in C#.
Upvotes: 0
Views: 1915
Reputation: 10849
Use DateTime.UtcNow.Date
DateTime.UtcNow.Date.AddDays(1).AddSeconds(-1).ToString("o")
The output of above is
2021-05-28T23:59:59.0000000Z
Upvotes: 2