-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdate.html
More file actions
21 lines (21 loc) · 779 Bytes
/
date.html
File metadata and controls
21 lines (21 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<script>
(function(){
const now = new Date()
let offset = now.getTimezoneOffset()
let dst = 60
if( ( now.getMonth() < 3)&&( now.getDate() < 10)){ dst = 0
}
if( ( now.getMonth() > 9 ) && ( now.getDate() < 2 ) ){ dst = 0}
switch(offset)
{
case (300 - dst ) : offset = 'EastCost' ; break
case (360 - dst) : offset = 'Central' ; break
case(420 - dst ) : offset = 'Mountain' ; break
case (480 - dst ) : offset = 'Pacific' ; break
default : offset = 'All'
}
console.log('System Time: ' + now.toString())
console.log('UTC (GMT) Time: ' + now.toUTCString())
console.log('\nWelcome to ' + offset + 'Visitors' )
})()
</script>