In designing web applications especially using Asp.net MVC4 c#, once I use
private DateTime currentDateTime = DateTime.Now;
somewhere in my code and save currentDateTime in a database; and then, I deploy my application in the web,
What will be the value of currentDateTime?
a. DateTime of the browser/computer which opened my application (timezone issue)
b. DateTime of the server in which I deployed my application (all values are in under one timezone)
Sorry, but I am just starting in web applications so this one confuses me. Hope you can clarify it to me. Thanks.
The value will the local time on the server.
However, I would strongly recommend using Universal Coordinated Time (UTC) eg,
DateTime.UtcNow, it makes reasoning about date times much simpler and will mean that you will be able to host your application anywhere in the world without adverse affects.