Today I want to transfrom date into different format using jQuery/Javascript :
$date = '2013-04-01T19:45:11.000Z'
$cool = date('Y-m-d',strtotime($date));
How can I do that (PHP) in jQuery/Javascript ?
Thanks!
Use the javascript date object.
<script>
  var date = new Date('2013-04-01T19:45:11.000Z');
  var day = date.getDate();
  var month = date.getMonth();
  var year = date.getFullYear();
  document.write(year + '-' + month + '-' + day);
</script>
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With