How do I change the date format?

Post any questions regarding your phpScheduleIt mySeat 1.8.x install

How do I change the date format?

Postby gymrat » 17 Jul 2010, 01:51

I'm using myseat 1.8x. Right now the dates are shown as d/m/y. I would like to change it to mm/dd/yyyy in the emails to admin and customer as well as in the backend of the system.

For the emails: I tried changing:

Code: Select all
   $body .= "Date ".$day."/";
   $body .= $month."/";
   $body .= $year."\n";


to

Code: Select all
   $body .= "Date ".$month."/";
   $body .= $day."/";
   $body .= $year."\n";


But it doesn't seem to work and now my reservation confirmation emails aren't even being sent to admin or customer.
Can someone show me how to change this?
gymrat
 
Posts: 8
Joined: 16 Apr 2009, 03:33

Re: How do I change the date format?

Postby admin » 17 Jul 2010, 05:45

Hello,

in webform/index.php line 408:

Insert :
Code: Select all
$print_date  = ($tformat == 24) ? date("d.m.Y", mktime(0,0,0,$month,$day,$year)) : date("F d Y", mktime(0,0,0,$month,$day,$year));


and change the lines 504/503 ff to
Code: Select all
   $body .= "Date ".$print_date."\n";


see php date function for date formats: http://php.net/manual/en/function.date.php at line 408.

Best regards
Bernd
admin
Site Admin
 
Posts: 255
Joined: 26 Mar 2008, 16:22

Re: How do I change the date format?

Postby gymrat » 17 Jul 2010, 07:25

Bernd,

Thank you very much for the quick reply. I will try this.

I love this script!! Keep up the good work.
gymrat
 
Posts: 8
Joined: 16 Apr 2009, 03:33


Return to mySeat 1.8.x

Who is online

Users browsing this forum: No registered users and 1 guest

cron