5

How do I echo a date as a string such as 07/18(month/day)?

John
  • 11,516
  • 11
  • 87
  • 151
Brandy
  • 514
  • 2
  • 11
  • 29

1 Answers1

8
<?php

echo date('m/d');

?>

If you already have the timestamp, just use it in the second parameter:

<?php

echo date('m/d', time());

?>

demo

iautomation
  • 898
  • 10
  • 17