View Full Version : :: Local Time script article adapting to ASP.NET

01-31-2012, 10:01 AM
Script:Local Time
Hello I read the Local Time script article and tried to use it unsuccessfully I think it's because the script supports ASP pages but not ASP.NET pages. How can I make it workable with ASP.NET? Thank you. Dov.

02-01-2012, 08:50 AM
Warning: Please include a link to the DD script in question in your post, in this case http://www.dynamicdrive.com/dynamicindex6/localtime.htm See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

I'm not familiar with ASP.net, but I'm sure it supports a way to get the server's time. Once you find out how, the line to edit inside the script to include that function call is the following:

var servertimestring=(servermode=="server-php")? '<? print date("F d, Y H:i:s", time())?>' : (servermode=="server-ssi")? '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' : '<%= Now() %>'