-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathDate1.js
More file actions
53 lines (34 loc) · 1.07 KB
/
Date1.js
File metadata and controls
53 lines (34 loc) · 1.07 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const date = new Date();
console.log(date);
console.log(typeof date);
const currDate = date.getTime()
console.log("currDate" , currDate) // time stamp in millisecond
console.log(date.getFullYear())
console.log(date.getSeconds())
console.log(date.getHours());
console.log(date.getMonth())
console.log(date.getMonth())
console.log(date.toLocaleDateString())
// 0 => January
// 11 => December
const milli = 1671557249838; // Tue Dec 20 2022 22:57:29 GMT+0530 (India Standard Time)
const date1 = new Date(milli);
console.log(date1)
const monthArray = ['Jan' , 'Feb' , 'march' , 'april' , 'may' , 'june' , 'july' , 'aug' , 'september' , 'oct' , 'november' , 'dec'] ;
const monthobj = {0 : 'Jan' , 1: 'Feb' , 2:'march' , 3:'april' , 4:'may' , 5:'june' , 6:'july' , 7:'aug' , 8:'september' , 9:'oct' , 10:'november' , 11:'dec'} ;
console.log(monthArray[date1.getMonth()]);
// abhishek
// Ashish
// Chandan
// dk verma
// nITESH
// Nikhat
// rAHUL Gupta
// rAHUL Seth
// Simita
// Nikhat
// vENU
// Shikhar
// dk verma
// abhishek
// harwinder