DEV Community

loading...

Discussion on: DateTime.Now: No, no...

Collapse
thorstenhirsch profile image
Thorsten Hirsch • Edited

SPAs made thinking about this problem a lot easier: localisation belongs in the client that runs in the browser. So in the backend (and its APIs) everything is UTC.

But I can relate to your point that it was hard when we were rendering web pages on the server. I actually have a Ruby-on-Rails project in which I had worked on the time-zone-abstracted layer, as well as on the time-zone-respecting layer. UTC belonged in the controllers and database for sure, local time in the views, but my models were a mix of both.

Collapse
alexeyripenko profile image
Alexey Ripenko

That is truth! I use momentjs to forget about time manipulation at all.

Collapse
lbugnion profile image
Laurent Bugnion Author

Yes to be clear I didn't intend to solve any time related issue here, merely wanted to make people aware that Azure servers run in UTC.