Feedback on: irt.org FAQ Knowledge Base Q504
Length:
Too short
Comments:
The response is not entirely accurate. <%= Time() or Now() or Date()%> will give the client side the servers date/time.
Comments:
You can use Server Side Includes to stuff hidden form variables with the server date and time; then use Javascript to work with the values.
Example code:
<form name="server_time_local">
<input type="hidden" name="year" value="">
</form>
<script language="JavaScript">
var year, month, day, hour, minute
t_form = document.forms["server_time_local"];
year = Number(t_form.year.value);
month = Number(t_form.month.value);
day = Number(t_form.day.value);
hour = Number(t_form.hour.value);
minute = Number(t_form.minute.value);
}
Comments:
You can use Server Side Includes to stuff hidden form variables with the server date and time; then use Javascript to work with the values.
Example code:
<pre>
<form name="server_time_local">
<input type="hidden" name="year" value="">
</form>
<script language="JavaScript">
var year, month, day, hour, minute
t_form = document.forms["server_time_local"];
year = Number(t_form.year.value);
month = Number(t_form.month.value);
day = Number(t_form.day.value);
hour = Number(t_form.hour.value);
minute = Number(t_form.minute.value);
}
</pre>
Worth:
Very worth reading
Length:
Technical:
Comments:
http://www.mresoftware.com/serverdate.htm
Information and scripts at the above URL will tell you how to get the server time in JavaScript without using SSI n an ordinary html page.