Created
December 3, 2020 06:28
-
-
Save codename065/315c8de2b2261929c90a7ccc2b913606 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<form> | |
<label>Due Date</label> | |
<input type="datetime-local" id="test-date"> | |
<button id="btn" onclick='convertdate()'>Convert</button> | |
<p id="result"></p> | |
</form> | |
<script> | |
function convertdate() | |
{ | |
var d = new Date(document.getElementById('test-date').value); | |
document.getElementById('test-date').value = (d.toString().split('GMT'))[0]; | |
} | |
// Objective Convert Date Picker date format to this format e.g. " October 15, 2021 20:00 " | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment