Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getTime(objId)
- {
- let obj = document.getElementById(objId);
- let today = new Date();
- let options = {day:"numeric", month:"numeric", year:"numeric",
- hour12:false, hour:"numeric", minute:"numeric"};
- //it'd be nice if you could specify a pattern like pattern:"{day}/{month}/{year} {hour}:{minute}"
- obj.innerHTML = new Intl.DateTimeFormat("en-GB", options).format(today);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement