You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In controllers, in order to display posts, the PubDate of posts is compared with DateTime.UtcNow, only the datetime of the posts is local, even if retrieved from a UTC formatted string. It should be
post.PubDate <= DateTime.Now or post.PubDate.ToUniversalTime() <= DateTime.UtcNow
The text was updated successfully, but these errors were encountered:
Actually, my solution was to load all dates from XML as universal time, as it is proper, so the code in the controllers would continue to work as expected. So PubDate = DateTime.Parse(ReadValue(entry, "published")).ToUniversalTime() and so on. But then I had an issue with the display of the date, so I've added a span around the displayed time then added jQuery code to read the time datetime attribute, parse it, then display it in local time. I've also changed the DateTime.ToString parameter for rendering the datetime attribute to "o" from "s".
In controllers, in order to display posts, the PubDate of posts is compared with DateTime.UtcNow, only the datetime of the posts is local, even if retrieved from a UTC formatted string. It should be
post.PubDate <= DateTime.Now or post.PubDate.ToUniversalTime() <= DateTime.UtcNow
The text was updated successfully, but these errors were encountered: