Forums: [SOLVED] Changing Date format - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

[SOLVED] Changing Date format Date format to d/m/Y Rate Topic: -----

#1 User is offline   shoppy 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 196
  • Joined: 08-February 08
  • Location:Zwolle (NL)

Posted 21 August 2018 - 10:24 AM

After adding a new record in the database an email is send to the costumer.
The mail contains the date of the apointment.
That date is like 2018-08-21 00:00 when I do it like this

$message  .= 'Youre welcome on  '.$values['Datum']. 'blah blah blah'; 


I used the code that Christian gave in http://asprunner.com...e-format-issue/
but that just gives the current date.

$date = new DateTime($Datum);
$Tijd = $date->format('d/m/Y');

$message  .= 'Youre welcome on  '.$Tijd. 'blah blah blah';



What am I doing wrong?
"Realy love this programm"
0

#2 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 16109
  • Joined: 03-February 03
  • Gender:Male

Posted 21 August 2018 - 03:56 PM

$date = new DateTime($values['Datum']);
$Tijd = $date->format('d/m/Y');

$message  .= 'Youre welcome on  '.$Tijd. 'blah blah blah';

Best regards,
Sergey Kornilov
0

#3 User is offline   shoppy 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 196
  • Joined: 08-February 08
  • Location:Zwolle (NL)

Posted 22 August 2018 - 05:41 AM

View Postadmin, on 21 August 2018 - 05:56 PM, said:

$date = new DateTime($values['Datum']);
$Tijd = $date->format('d/m/Y');

$message  .= 'Youre welcome on  '.$Tijd. 'blah blah blah';



Great Sergey, this works.
"Realy love this programm"
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users