Reputation: 36044
According to this DateTime.Now vs. DateTime.UtcNow you store date time information in UTC and show it to user as DateTime.Now. If it is on web application, how does DateTime.Now know about user's location and adjusts UTC time accordingly? Is location inferred from header information that user passes in?
Upvotes: 2
Views: 1184
Reputation: 46057
DateTime.Now
returns the current time according to the server, not the client.
Upvotes: 2
Reputation: 7138
As Blake said, it doesn't.
If a server is calculating the current time for the end user, it must be based on information that user has provided. Otherwise, you typically would use javascript to provide the current date/time reference based on the local machine's clock.
Upvotes: 4
Reputation: 7797
DateTime.Now does not know the user's location and adjust for it. It is based off the server the site is running on.
Upvotes: 7