javascript - current date time to dd-mon-yyyy hh:mm:ss -




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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -