PDA

View Full Version : current local time


Crash1hd
06-11-2003, 04:39 AM
How can I get the following code to give the local time of the user not the server as it gives the server not the local

code here

<% If dcheck = 1 Then ToFH=Hour(now)%>

Cause I know that in Javascript which is client side is

NowHour = Now.getHours( );

angiras
06-11-2003, 07:43 AM
en vb net

Dim dNow As DateTime = DateTime.Now.UtcNow

then you can format it

= dNow.ToShortTimeString

Crash1hd
06-11-2003, 08:07 AM
Ok Thanks for the info but how about an example as I am not quite sure how you are ariving at that!

raf
06-11-2003, 08:20 AM
Can a server side language give you the clientsided time?

I think the easiest way is to use clientsided javascript and post the timevalue to the server. Then you can get it with a request.form("blabla")

But there's not much use for something like that ...

angiras
06-11-2003, 10:05 AM
example ?
but it is an example , you have nothing else to do (only it is .NET langage)

with that code you get localTime

Crash1hd
06-11-2003, 11:52 PM
Ahh I dont know .net at all right now! But thankyou :)