VenusInterns / BlogTemplate

MIT License
208 stars 38 forks source link

Consider using DateTimeOffset instead of DateTime for storing dates/times #50

Closed Eilon closed 7 years ago

Eilon commented 7 years ago

The use of DateTime is prevalent in the codebase: https://github.com/VenusInterns/BlogTemplate/search?utf8=%E2%9C%93&q=datetime&type=

But, per MSDN, it is preferred to use DateTimeOffset when referring to actual times (i.e. the actual time a blog post was posted, or a comment was commented).

In fact, it goes so far as to say:

Note

These uses for DateTimeOffset values are much more common than those for DateTime values. As a result, DateTimeOffset should be considered the default date and time type for application development.

The change is probably straightforward: just search & replace all DateTime with DateTimeOffset.

umaslakshmi commented 7 years ago

The merged PR (#78) was causing an issue in the HTML so this is fixed in #81