-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaScrip.js
More file actions
24 lines (20 loc) · 987 Bytes
/
JavaScrip.js
File metadata and controls
24 lines (20 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function myFunction() {
var today = new Date();
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var today = new Date();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = date+' '+time;
return dateTime;
}
function alertAndLogDate(){
// get date and time and store in variable because we are using the value for two different method calls
var date = myFunction();
// send alert with that date clear Timeout
alert(Date());
// log the date to console
console.log(Date());
}