0
votes

When I view my ServiceStack endpoints through a browser, I get the very helpful snapshot of the data in a convenient HTML table. The title looks something like this:

Snapshot of EndPoint generated by ServiceStack on DateTime

The DateTime shown seems to be in UTC format and I'm trying to work out why. In the UK now it is British Summer Time (UTC +1) so ServiceStack always shows the wrong time for this.

The source code is here: https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack/WebHost.Endpoints/Formats/HtmlFormat.cs#L63

My question is:

Is this is a minor bug or is there another reason I am not aware of for displaying the date and time in UTC?

1
Why is it the "wrong time"? :-)Roger Lipscombe
@RogerLipscombe I'm not sure I follow. It's the wrong time because it is displaying UTC, which is not the correct time for my timezone (BST). Eg. it displays 11:43:59 when it is actually 12:43:59.gregpakes
It's not wrong because that is the time in UTC. It should either be explicit about that (easy) or display it in the timezone of the browser user (actually a bit harder).Roger Lipscombe
@RogerLipscombe Thanks for your response. I agree that it is displaying the correct time in UTC, but the purpose of this DateTime is to display the time to the user. Therefore, I think, it should be shown in their timezone. If this is not possible, I think the correct DateTime on the server would be better than UTC. The purpose of this page is for developer consumption, therefore I think server time (DateTime.Now) is better than UTC time.gregpakes

1 Answers

0
votes

Dates always travel on the wire as UTC, the purpose of ServiceStack's HTML5 Report Format is to display the data from the web service in a human friendly format.