Jump to content

change date format


mastubbs

Recommended Posts

Hi all,

 

So i am passing a data from a form, in the format yyyy-mm-dd. I want to convert that to dd/mm/yyyy but for some reason i cant get it to work. Can anybody tell me what im doing wrong?

 

$date = $_GET['date'];
$date_uk = $date->format('d/m/Y');
Error is:
 
Fatal error: Call to a member function format() on a non-object
 
 
Thanks in advance for any help,
 
Matt
Link to comment
https://forums.phpfreaks.com/topic/280491-change-date-format/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.