Tags
Asked 2 years ago
9 Jun 2021
Views 123
ajamil

ajamil posted

String date current date/time?

String date current date/time?
Mahesh Radadiya

Mahesh Radadiya
answered Apr 26 '23 00:00

To get the current date/time in string format, you can use the date () function in PHP. Here is an example:



$currentDateTime = date('Y-m-d H:i:s');
echo $currentDateTime;

This will output the current date/time in the format YYYY-MM-DD HH:MM:SS. You can adjust the format to your desired format using the parameters in the date () function.
Post Answer