Questions
leon21leon21asked 4 months ago
I want to know about how to get a date only in PHP?
1

1 Answers

Accepted
codegenlabcodegenlabanswered 4 months ago
Following code will show you how to get a date in PHP. Please follow it.
  • d – Represents the day of the month (01 to 31)
  • m – Represents a month (1 to 12)
  • Y – Represents a year (in four digits)
<?php
echo "Today is " . date("Y/m/d") . "<br>";
echo "Today is " . date("Y.m.d") . "<br>";
echo "Today is " . date("Y-m-d") . "<br>";
?>
1