File: 006.js

package info (click to toggle)
apache2 2.4.66-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 59,960 kB
  • sloc: ansic: 212,327; python: 13,830; perl: 11,307; sh: 7,266; php: 1,320; javascript: 1,314; awk: 749; makefile: 715; lex: 374; yacc: 161; xml: 2
file content (31 lines) | stat: -rw-r--r-- 839 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
 * JavaScript Functions File
 */
function returnDate()
{
  var currentDate;
  currentDate=new Date();
  var dateString=(currentDate.getMonth()+1)+'/'+currentDate.getDate()+'/'+currentDate.getFullYear();
  return dateString;
}

function returnHour()
{
  var currentDate;
  currentDate=new Date();
  var hourString=currentDate.getHours()+':'+currentDate.getMinutes()+':'+currentDate.getSeconds();
  return hourString; 
}

function javaScriptMessage(){
	return 'This section is generated under JavaScript:<br>';
}

function mainJavascript(){
	document.write(javaScriptMessage())
	document.write('<ul class="listElements">');
	document.write('<li>Current date (dd/mm/yyyy): ' + returnDate());
	document.write('<br>');	
	document.write('<li>Current time (hh:mm:ss): '+returnHour());
	document.write('</ul>');
}