Skip to content

Instantly share code, notes, and snippets.

@codename065
Created December 3, 2020 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codename065/315c8de2b2261929c90a7ccc2b913606 to your computer and use it in GitHub Desktop.
Save codename065/315c8de2b2261929c90a7ccc2b913606 to your computer and use it in GitHub Desktop.
<!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