-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path08_dateTime.js
More file actions
40 lines (30 loc) · 921 Bytes
/
08_dateTime.js
File metadata and controls
40 lines (30 loc) · 921 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// let date = new Date()
// console.log(date)
// console.log(date.toString())
// console.log(date.toDateString())
// console.log(date.toISOString())
// console.log(date.toJSON())
// console.log(date.toLocaleDateString())
// console.log(date.toLocaleString())
// console.log(date.toUTCString())
// first way
// let myDate = new Date(2024 , 6 , 3)
// console.log(myDate.toDateString());
// second way
// let myDate = new Date("2024-07-03")
// console.log(myDate.toDateString());
// third way
// let myDate = new Date("07-03-2024")
// console.log(myDate.toDateString());
//time
// let timestamp = Date.now()
// console.log(timestamp);
// console.log(myDate.getTime());
//converting time
// console.log(Math.floor(Date.now()/1000))
//about localDateString functionalities
// let time = new Date()
// time.toLocaleDateString('default', {
// weekday: "long"
// }
// )