Link to home
Start Free TrialLog in
Avatar of pertrai1
pertrai1

asked on

Date Display

Hello, I am pulling a start date and an end date from mysql and I would like for it to be mm/dd/yyyy. Right now it is showing like this:
2008-09-13- 2008-09-14
How would I be able to change this and where would I have to change the code. I pull both of these by calling <?PHP echo"$row_events['start']";?>-<?PHP echo""$row_events['end']"; ?>

Thank you for helping me to know where to change code for this.

Rob
Avatar of HuyBD
HuyBD
Flag of Viet Nam image

try this
<?PHP echo date('m-d-Y',$row_events['start']);?>-<?PHP echo date('m-d-Y',$row_events['end']); ?>

Open in new window

Avatar of pertrai1
pertrai1

ASKER

HuyBD, I tried this and it is showing the date as 12-31-1969? when that is not the date in the database. I have the fields start and end set in the database as date fields. Am I doing something wrong?

Rob
ASKER CERTIFIED SOLUTION
Avatar of paulp75
paulp75
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial