I need some help with set up the date format.
I'm still trying to find out how I can set up the format to the next day, the day two and the day three date when I work out with the hours.
Example: I set up the date format from today and the time is 10:00 AM, 11:00 AM, 12:00 PM, the format is 20140424100000, 20140424110000, 20140424120000 and so on until when I reaction to the 12:00 AM, I want to set up the format to the next day 20140425000000, 20140425003000, 20140425020000, 20140425023000 until when I reaction to the next 12:00 AM I want to set up the new format to the day two 20140426000000, 20140426003000, 20140426010000.
My problem is when I'm parsing the list of time strings from my script, how I can work out the format with the date and the time?
Here is the PHP:
<?php
ini_set('max_execution_time', 300);
$errmsg_arr = array();
$errflag = false;
include ('simple_html_dom.php');
foreach($html->find('p[id=links]') as $element)
{
$program_list[ $count ] = array();
$id_split = explode("?", $element->plaintext);
$id_split = explode("&", $link_split[1]);
$channels = explode("channels=",$id_split[0]);
$channels = $channels[1];
$id = explode("id=",$id_split[1]);
$id = $id[1];
$html_two = file_get_html("http://www.mysite.com/myscript.php?getime);
//time1
$time1 = $html_two->find('span[id=time1]',0)->plaintext;
$hoursMinutes = explode(":", $time1[0]);
$hours = $hoursMinutes[0];
$minutes = $hoursMinutes[1];
$time1 = explode(" ", $time1);
$hoursMinutes = explode(":", $time1[0]);
$hours = $hoursMinutes[0];
$minutes = $hoursMinutes[1];
//time2
$time2 = $html_two->find('span[id=time2]',0)->plaintext;
$hoursMinutes = explode(":", $time2[0]);
$hours = $hoursMinutes[0];
$minutes = $hoursMinutes[1];
$time2 = explode(" ", $time2);
$hoursMinutes = explode(":", $time2[0]);
$hours = $hoursMinutes[0];
$minutes = $hoursMinutes[1];
//time3
$time3 = $html_two->find('span[id=time3]',0)->plaintext;
$hoursMinutes = explode(":", $time3[0]);
$hours = $hoursMinutes[0];
$minutes = $hoursMinutes[1];
$time3 = explode(" ", $time3);
$hoursMinutes = explode(":", $time3[0]);
$hours = $hoursMinutes[0];
$minutes = $hoursMinutes[1];
?>
Here is the time strings:
10:00 AM
11:00 AM
12:00 PM
12:30 PM
2:00 PM
2:30 PM
9:00 PM
11:00 PM
12:00 AM
12:30 AM
1:00 AM
1:30 AM
2:00 AM
11:00 PM
12:00 AM
12:30 AM
1:00 AM