javascript - current date time to dd-mon-yyyy hh:mm:ss -
this question has answer here:
- how format javascript date 36 answers
- where can find documentation on formatting date in javascript? 33 answers
- format javascript date yyyy-mm-dd 19 answers
- javascript format date / time [duplicate] 5 answers
- get string in yyyymmdd format js date object? 35 answers
in javascript need change current date in following format?i googled lot didnt find exact result.
i'm expecting current date format 22-sep-2017 13:37:02
thanks in advance
var ele = document.getelementsbytagname('h3')[0]; setinterval(function(){ var date =new moment().format('dd-mmm-yyyy hh:mm:ss'); ele.innerhtml = date;} ,1000);
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.js"></script> <h3></h3>
use momentjs , format date according need.
wiki
Comments
Post a Comment