Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Date and time update issue

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Date and time update issue

Postby Gianfran » Tue Feb 26, 2013 12:20 am

Hello,
I'm new here and don't have knowledge in PHP. anyway, i have a wesbite which display sport matches updated automatically from a XML feed provider. The problem is, at 12 AM the "Today's matches" should be updated, but instead it will update at 12 PM. in another way, it displays yesterday's matches till 12 PM for the next day. This is the code:
Code: Select all
<?php ob_start();
include('header.php');
$flagged1=0;
$flagged2=0;
if(isset($_GET["date"]) and $_GET["date"]!="")
{
$dtShow=$_GET["date"];
if($dtShow=="tomorrow")
{
$yest=date("y-m-d",time()+(60*60*48));
$time=date("y-m-d",time()+(60*60*24));
}
else if($dtShow=="yest")
{
$yest=date("y-m-d",time());
$time=date("y-m-d",time()-(60*60*24));
}
else
{
$yest=$_GET["date"]." 00:00:00";
$newDate = strtotime($yest);
$yest=date('y-m-d', $newDate);
$time=date("y-m-d",$newDate-(60*60*24));
}
}
else
{
$yest=date("y-m-d",time()+(60*60*24));
$time=date("y-m-d",time());


Any help will be really appreciated.

Thanks!
Gianfran
New php-forum User
New php-forum User
 
Posts: 1
Joined: Mon Feb 25, 2013 11:58 pm

Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.