Joe Developer is tasked with displaying the start date of his ASP.NET application. Joe thinks he'll just add a DateTime field to global.asax and initialize the field during the Application_Start event.
<%@ Application Language="C#" %>
void Application_Start(object sender, EventArgs e)
StartDateTime = DateTime.Now;
public DateTime StartDateTime;
Whenever Joe needs to display the application start date, he accesses this public field.
Joe doesn't know what is wrong, but he is sure of one thing – the date that is displaying on his pages is not the date when the application started. Can you help out Joe one more time?