Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Did you get any error? You sure $user['birthday'] is a date object? Have you tried var_dump($user['birthday']);
- $user['birthday'] = date_create("2012-02-01");
- echo date_format($user['birthday'], 'm/j/Y');
- http://sandbox.onlinephpfunctions.com/code/9148ec9749452ae81e1e5966837e7681c858a2db
- Understand date object:
- http://sandbox.onlinephpfunctions.com/code/bae170dcbcc50609a4f04f31586c07364ab61e59
- http://php.net/manual/en/function.date-create.php
- http://sandbox.onlinephpfunctions.com/code/18dc8a4262424cfddccd29cae18214a32162cafe
- <?php
- $user['birthday'] = "2012-02-01";
- echo date('m/j/Y', strtotime($user['birthday']));
- ?>
- Remove the space from links for DEMO. Facebook seems to have problem with that. This is my 7th comments
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement