Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Arvin iuunhao
Added: Jun 18, 2018 8:10 AM
Views: 5
Tags: js
  1. function formatDate(now)   {
  2.   var y=now.getFullYear();
  3.   var m=now.getMonth()+1;
  4.   var d=now.getDate();
  5.   var h=now.getHours();
  6.   var m=now.getMinutes();
  7.   var s=now.getSeconds();
  8.   return y+"-"+m+"-"+d+" "+h+":"+m+":"+s;
  9. }