Skip to content

Instantly share code, notes, and snippets.

@devpilot
Created May 10, 2017 12:24
Show Gist options
  • Save devpilot/d89a79c4be98e1b4c73900e72105dae5 to your computer and use it in GitHub Desktop.
Save devpilot/d89a79c4be98e1b4c73900e72105dae5 to your computer and use it in GitHub Desktop.
extract date from js date
<?php
$jstime = "Mon Mar 20 2017 11:30:05 GMT+0530 (India Standard Time)";
$t = substr( $jstime, 0, strpos($jstime, '(') );
echo date( 'Y-m-d', strtotime($t) );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment