How to get today's date in a particular format in PHP?

Viewed 13

What should I do, if I want to echo today's date from IST timezone? I want the date to be in a particular simple format, like ex. 10th Jul. 2021 / 7th Sep. 2021, etc. Is it possible? TBH I am a beginner in this field, so I am still learning stuff...

Any help would be appreciated! Thanks!

1 Answers

Update : I have solved my own question -

I built this code :

<?php
date_default_timezone_set('Asia/Calcutta');
echo date('jS F\, Y');
?>

And it worked out perfectly. I get my desired result - 10th July, 2021

Related