goto;
Erfahrenes Mitglied
Schönen Guten Tag Liebe Community, ich stehe zurzeit vor einem Rätsel. Es Handelt sich um eine Auktionsplattform. Wenn man einen Artikel erstellt wird Startdatum und Enddatum korrekt in Die Datenbank eingetragen (bsp.: Startdatum 7.2.2009 // Enddatum +1tag (8.2.2009)), so bis dahin klappt alles nun aber zum auslesen. Bei der Seite item.php werden die Daten dann wieder aus der Datenbank ausgelesen, Artikelname / Beschreibung, alles Korrekt. Datum jedoch immer der 4.1.2008 oder der 5.1.2008. Hier mal ein Auszug aus der Seite:
So eigentlich sollte das Datum aus der DB geholt werden, tut es aber nicht
PHP:
}
$year = intval ( date("Y"));
$month = intval ( date("m"));
$day = intval ( date("d"));
$hours = intval ( date("H"));
$minutes = intval ( date("i"));
$seconds = intval ( date("s"));
$ends_year = substr ( $ends, 0, 4 );
$ends_month = substr ( $ends, 4, 2 );
$ends_day = substr ( $ends, 6, 2 );
$ends_hours = substr ( $ends, 8, 2 );
$ends_minutes = substr ( $ends, 10, 2 );
$ends_seconds = substr ( $ends, 12, 2 );
# $difference = intval( mktime( $ends_hours,$ends_minutes,$ends_seconds,$ends_month,$ends_day,$ends_year)) - intval(mktime($hours,$minutes,$seconds,$month,$day,$year));
$difference = intval( mktime( $ends_hours,$ends_minutes,$ends_seconds,$ends_month,$ends_day,$ends_year)) - time();
if ($difference > 0) {
$TPL_days_difference_value = intval($difference / 86400).$MSG_126;
$difference = $difference - ($TPL_days_difference_value * 86400);
$hours_difference = intval($difference / 3600);
if(strlen($hours_difference) == 1)
{
$hours_difference = "0".$hours_difference;
}
$TPL_hours_difference_value = $hours_difference.":";
$difference = $difference - ($hours_difference * 3600);
$minutes_difference = intval($difference / 60);
if (strlen($minutes_difference) == 1)
{
$minutes_difference = "0".$minutes_difference;
}
$TPL_minutes_difference_value = $minutes_difference.":";
$difference = $difference - ($minutes_difference * 60);
$seconds_difference = $difference;
if (strlen($seconds_difference) == 1)
{
$seconds_difference = "0".$seconds_difference;
}
$TPL_seconds_difference_value = $seconds_difference;
} else {
$TPL_days_difference_value = "$err_font $MSG_911 </FONT>";
$TPL_hours_difference_value = "";
$TPL_minutes_difference_value = "";
$TPL_seconds_difference_value = "";
}
$TPL_num_bids_value = $num_bids;
$TPL_currency_value1 = print_money($minimum_bid);
$TPL_currency_value2 = print_money($high_bid);
$TPL_currency_value3 = print_money($increment);
$TPL_currency_value4 = print_money($next_bid);
$TPL_next_bid_value = $next_bid;
$TPL_user_id_value = $user_id;
$TPL_title_value = $title;
$TPL_category_value = $category;
$TPL_id_value = $id;
$TPL_description_value = nl2br($description);
if ( $pict_url )
{
$TPL_pict_url = "<IMG SRC=\"$pict_url\" BORDER=0>";
}
else
{
$TPL_pict_url = "<B>$MSG_114</B>";
}
include ("./includes/countries.inc.php");
while ( list($key, $val) = each ($countries) )
{
if ( $val = $location )
{
$location_name = $countries[$val];
}
}
$TPL_location_name_value = $location_name;
$TPL_location_zip_value = "(".$location_zip.")";
if ( $shipping == '1' )
{
$TPL_shipping_value = $MSG_038;
}
else
{
$TPL_shipping_value = $MSG_032;
}
if ( $international )
{
$TPL_international_value = ", $MSG_033";
}
else
{
$TPL_international_value = ", $MSG_043";
}
$payment_methods = explode("\n",$payment);
$i = 0;
$c = count($payment_methods);
$began = false;
while ($i<$c)
{
if (strlen($payment_methods[$i])!=0 )
{
if ($began)
$TPL_payment_value .= ", ";
else
$began = true;
$TPL_payment_value .= trim($payment_methods[$i]);
}
$i++;
}
$year = substr($date,0,8);
$month = substr($date,4,2);
$day = substr($date,6,2);
$hours = substr($date,8,2);
$minutes = substr($date,10,2);
$seconds = substr($date,12,2);
$date_string = ArrangeDate($day,$month,$year,$hours,$minutes);
$TPL_date_string1 = $date_string;
$year = substr($ends,0,4);
$month = substr($ends,4,2);
$day = substr($ends,6,2);
$hours = substr($ends,8,2);
$minutes = substr($ends,10,2);
$date_string = ArrangeDate($day,$month,$year,$hours,$minutes);
$TPL_date_string2 = $date_string;
$c_name[] = array(); $c_id[] = array();
$TPL_cat_value = "";