cjhammer2004 Posted January 21, 2006 Posted January 21, 2006 Is there anyway of getting the Server Data and Time via ASP.Net for example Request.ServerVariables("Date_Time")? Many Thanks Quote
Administrators PlausiblyDamp Posted January 21, 2006 Administrators Posted January 21, 2006 ASP.Net code runs on the server - you could simply use Datetime.Now to get the date on the server the code is executing. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
cjhammer2004 Posted January 21, 2006 Author Posted January 21, 2006 Thanks for your reply, I have done what you have suggested but the date and time seems to be taken from the Client pc and not the server hosting the ASP.Net page. Any suggestions would be greatly appreciated. Quote
Administrators PlausiblyDamp Posted January 21, 2006 Administrators Posted January 21, 2006 Could you post the code you are using as it should be returning the server's date and time. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
cjhammer2004 Posted January 22, 2006 Author Posted January 22, 2006 <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Me.Title = "Forums (" & DateValue(Now()) & ")" If Month(DateValue(DateTime.Now)) > 6 And Month(DateValue(DateTime.Now)) < 10 Then New.Visible = True End Sub </script> Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.