-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdate.html
More file actions
107 lines (103 loc) · 2.62 KB
/
date.html
File metadata and controls
107 lines (103 loc) · 2.62 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>date</title>
<script src="jquery-3.7.1.min.js"></script>
<style>
* {
font-family: monospace;
}
</style>
</head>
<body>
<h1>US</h1>
<div id="us"></div>
<h2>in words</h2>
<div id="us-words"></div>
<h1>iso</h1>
<div id="iso"></div>
<h1>table</h1>
<table>
<thead>
<tr>
<th>month</th>
<th>number</th>
<th>season</th>
</tr>
</thead>
<tbody>
<tr>
<td>Jan</td>
<td>1</td>
<td>winter</td>
</tr>
<tr>
<td>Feb</td>
<td>2</td>
<td>winter</td>
</tr>
<tr>
<td>Mar</td>
<td>3</td>
<td>spring</td>
</tr>
<tr>
<td>Apr</td>
<td>4</td>
<td>spring</td>
</tr>
<tr>
<td>May</td>
<td>5</td>
<td>spring</td>
</tr>
<tr>
<td>Jun</td>
<td>6</td>
<td>summer</td>
</tr>
<tr>
<td>Jul</td>
<td>7</td>
<td>summer</td>
</tr>
<tr>
<td>Aug</td>
<td>8</td>
<td>summer</td>
</tr>
<tr>
<td>Sep</td>
<td>9</td>
<td>fall</td>
</tr>
<tr>
<td>Oct</td>
<td>10</td>
<td>fall</td>
</tr>
<tr>
<td>Nov</td>
<td>11</td>
<td>fall</td>
</tr>
<tr>
<td>Dec</td>
<td>12</td>
<td>winter</td>
</tr>
</tbody>
</table>
<script>
// Why hello there! This page just exists because I'm always confused
// about how the US date format works, and about month numbers
const date = new Date();
const usDateString = date.toLocaleDateString("en-US");
$("#us").html(usDateString);
$("#us-words").html(date.toDateString()); // .toDateString, conveniently, is written by Americans
$("#iso").html(date.toISOString().split("T")[0]);
$("title").html(date.toLocaleDateString());
</script>
</body>
</html>