getSeconds() and getMIlliseconds() return the seconds and milliseconds values.
<SCRIPT LANGUAGE=”JAVASCRIPT”>
<!–
var d = new Date();
var curr_hour = d.getHours();
var curr_min = d.getMinutes();
var curr_sec = d.getSeconds();
var curr_msec = d.getMilliseconds();
document.write(curr_hour + “:” + curr_min + “:”
+ curr_sec + “:” + curr_msec);
//–>
</SCRIPT>
Posts Tagged ‘system time’
Get the System time with the number of seconds and milliseconds using javascript
Posted in javascript, tagged Date, getHours, getMilliseconds, getMinutes, getSeconds, javascript, milliseconds, seconds, system time, SystemTime on July 25, 2008 | Leave a Comment »
Reading the system time in C#
Posted in C#.NET, tagged .net, C#, currentSystemTime, DateTime, read, system time on July 21, 2008 | Leave a Comment »
In order to retrieve the current system time, we can use the static property “Now” of the ” DateTime” class. For example the following two lines of code
DateTime currentSystemTime = DateTime.Now;
Console.WriteLine(currentSystemTime);
print out something like this:
4/7/2008 4:05:35 PM


