Last active
December 2, 2015 03:38
-
-
Save a-pasquale/23668e53e28a01de862c to your computer and use it in GitHub Desktop.
Localtime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<label id="date" for="date">10:00 AM PST</label> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Localtime | |
--------- | |
Display a date in the local timezone. | |
A [Pen](http://codepen.io/apasquale/pen/QyLKRx) by [Andrew Pasquale](http://codepen.io/apasquale) on [CodePen](http://codepen.io/). | |
[License](http://codepen.io/apasquale/pen/QyLKRx/license). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options = { timeZoneName: 'short' }; | |
$('#date').html( new Date( Date.UTC(2015, 12, 11, 18, 0)).toLocaleTimeString('en-US', options).replace(/:\d+ /, ' ') ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://code.jquery.com/jquery-latest.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div { | |
width: 200px; | |
margin: 100px auto; | |
padding: 50px; | |
text-align: center; | |
background-color: steelblue; | |
border-radius: 20px; | |
} | |
label { | |
font-family: Arial; | |
font-size: 1.4em; | |
color: #ffffff; | |
margin-left: 10px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment