How to use client date rather than server date
Posted on 2011-02-25
I have a web application written using vb.net.
There are a number of stored procedures that include date field parameters. These are passed in using the SqlDbType.DateTime datatype via a SQLParameter. This works fine.
My issue is that I use the Now() function in the aspx.vb code behind files to retrieve the current date/time which is then passed to the stored procedure.
This works fine when testing on my development machine but when using the site via the web host (based in USA) I am getting the US date/time stored in the database which is 6 hours different.
Does anyone know a solution so that I can use the client datetime and set the sqlparameter using this via the code behind files.
Thanks in advance,