-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer.js
More file actions
23 lines (17 loc) · 794 Bytes
/
timer.js
File metadata and controls
23 lines (17 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
https://dotnet.microsoft.com/download/thank-you/net472-developer-pack
var MyDate = new Date();
var MyDateString = '';
MyDate.setDate(MyDate.getDate());
var date = (MyDate.getDate()+1 < 10)?'0' + MyDate.getDate():MyDate.getDate();
var month = (MyDate.getMonth()+1 < 10)?'0' + MyDate.getMonth():MyDate.getMonth();
var year = MyDate.getFullYear();
var hour = (MyDate.getHours()+1 < 10)?'0' + MyDate.getHours():MyDate.getHours();
var min = (MyDate.getMinutes()+1 < 10)?'0' + MyDate.getMinutes():MyDate.getMinutes();
var sec = (MyDate.getSeconds()+1 < 10)?'0' + MyDate.getSeconds():MyDate.getSeconds();
MyDateString = date + '/' +
month + '/' +
year +' '+
hour + ':'+
min +':'+
sec;
console.log(MyDateString)