Listing dates as Sept 2-4,7-9 & Oct 4,5,6 etc.
Posted: Tue Mar 30, 2004 12:27 pm
I'm a newbie to dates in php and MySQL, and I have spent hours looking through forums for an answer to what I'm trying to do... I've found plenty on displaying single dates and comparing two dates, for example, but nothing on listing many dates...
Sorry if it's overkill, but I'll explain what I'm trying to do in detail so the real coders can point me in the right direction properly...
I've built a form to input lots of dates into a single row of a MySQL table. Specifically, I've got two kinds of dates: multi-day events (where I have a startdate and enddate) and single-day events. Each entry (row) in the table has up to 10 such start- and end-dates and 30 single-day event dates. The dates are of the 'date' type, such that they are MM-DD-YYYY in the db.
As an example, consider I want to list three multi-day events and two single days after each of multi-day events. I don't want to have the month displayed again and again, just once for each set of dates...
I'm trying to display the multi-day events as: Sept 22-28 / Oct. 2-8 and 14-18
for example
And display the single-day events as: Sept. 29 / Oct. 1,9,10,19 and 20
for example
I'm looking for some dates functions to help me sift through the raw MySQL date terms to make em pretty! Any help you can give would be very appreciated!
Sorry if it's overkill, but I'll explain what I'm trying to do in detail so the real coders can point me in the right direction properly...
I've built a form to input lots of dates into a single row of a MySQL table. Specifically, I've got two kinds of dates: multi-day events (where I have a startdate and enddate) and single-day events. Each entry (row) in the table has up to 10 such start- and end-dates and 30 single-day event dates. The dates are of the 'date' type, such that they are MM-DD-YYYY in the db.
As an example, consider I want to list three multi-day events and two single days after each of multi-day events. I don't want to have the month displayed again and again, just once for each set of dates...
I'm trying to display the multi-day events as: Sept 22-28 / Oct. 2-8 and 14-18
for example
And display the single-day events as: Sept. 29 / Oct. 1,9,10,19 and 20
for example
I'm looking for some dates functions to help me sift through the raw MySQL date terms to make em pretty! Any help you can give would be very appreciated!