How To Read Local Machine Time
-
I am developing in VS2008 Express Edition using ASP.net and VB.net. I would like to record the local time when something happens in the application (say a button is pressed). If you use the Now() function, it returns the Servers time. I want the time on the local computer. I have searched high and low and am baffled this is not needed more often. There is practically no mention of it on the web. Any pointers would be appreciated. Thanks, Karl Tomecek
-
I am developing in VS2008 Express Edition using ASP.net and VB.net. I would like to record the local time when something happens in the application (say a button is pressed). If you use the Now() function, it returns the Servers time. I want the time on the local computer. I have searched high and low and am baffled this is not needed more often. There is practically no mention of it on the web. Any pointers would be appreciated. Thanks, Karl Tomecek
This question really belongs in the ASP.NET forum. It has nothing to do with VB.NET at all. There is nothing that the browser sends to your ASP.NET code that will tell you what timezone the client is in. You'll probably have to use JavaScript code in the page to set a hidden field with the clients time when the form is submitted back to your server to get the client time, or at least the timezone the client is in. Your ASP.NET code would then have to parse the date time value found in the hidden field to get at this information.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
I am developing in VS2008 Express Edition using ASP.net and VB.net. I would like to record the local time when something happens in the application (say a button is pressed). If you use the Now() function, it returns the Servers time. I want the time on the local computer. I have searched high and low and am baffled this is not needed more often. There is practically no mention of it on the web. Any pointers would be appreciated. Thanks, Karl Tomecek
I think it would be possible via the Javascript. First get the time via jscript and then submit the form.
Parwej Ahamad R & D with IIS 5.0/6.0
-
This question really belongs in the ASP.NET forum. It has nothing to do with VB.NET at all. There is nothing that the browser sends to your ASP.NET code that will tell you what timezone the client is in. You'll probably have to use JavaScript code in the page to set a hidden field with the clients time when the form is submitted back to your server to get the client time, or at least the timezone the client is in. Your ASP.NET code would then have to parse the date time value found in the hidden field to get at this information.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008I beleive it is available in the environment variables which can be got at via JS
Never underestimate the power of human stupidity RAH
-
I beleive it is available in the environment variables which can be got at via JS
Never underestimate the power of human stupidity RAH
Does that also apply to JavaScript running in a browser on a *nix box??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Does that also apply to JavaScript running in a browser on a *nix box??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008I see what you mean, I may be thinking of the win env vars. Is there a equivalent to the var set in *nix is probably the relevant ?
Never underestimate the power of human stupidity RAH
-
I am developing in VS2008 Express Edition using ASP.net and VB.net. I would like to record the local time when something happens in the application (say a button is pressed). If you use the Now() function, it returns the Servers time. I want the time on the local computer. I have searched high and low and am baffled this is not needed more often. There is practically no mention of it on the web. Any pointers would be appreciated. Thanks, Karl Tomecek
Thanks for all your input. It helped me find a great website with a video that more or less shows you how to do this. In the end, it was done with Javascript storing the date in a hidden variable and then the app has access to that data. Here is the link in case anyone ever needs to learn how to do this: http://www.asp.net/learn/videos/video-275.aspx Thanks to you all once again... Regards, Karl