Results 1 to 5 of 5
  1. #1

    Default need help: php error


    <?php
    $datetoday = date("m",time()) . "-" . date("d",time()) . "-"
    date("Y", time());
    echo $datetoday;
    ?>

    returns,

    Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in C:\server\www\myserver.dev\public_html\date.php on line 11
    11

    how to solve this? napansin ko kasi blank yung timezone id sa php.ini file

    *using php 5.3.5, windows 7, apache 2.2
    *everything else works fine

  2. #2

    Default Re: need help: php error

    add a default timezone when displaying date.

    Code:
    <?php
    date_default_timezone_set('Asia/Manila');
    
    $datetoday = date("m",time()) . "-" . date("d",time()) . "-"
    date("Y", time());
    echo $datetoday;
    ?>
    Last edited by ChaosOrb; 11-26-2011 at 12:16 AM. Reason: update

  3. #3

    Default Re: need help: php error

    function call lang pala yun? hehe... thanks

  4. #4

    Default Re: need help: php error

    Quote Originally Posted by snowleopard View Post
    function call lang pala yun? hehe... thanks
    you can also add it in php.ini file if you don't want to add default time zone in every php file you create when displaying date.

  5. #5

    Default Re: need help: php error

    that's the prob, i tried placing a value on the date.timezone in php.ini, i still get same result, has tried to exclude date_default_timezone_set(), uncomment the date.timezone to activate it, but same result, i ended up typing a long code instead

    <?php
    date_default_timezone_set('Asia/Manila');
    $datemonth = date("m",time());
    $datetoday = date("d",time());
    $yearnow = date("Y",time());
    echo $datetoday, '/' ,$yearnow, '/' ,$datemonth;
    ?>

    yung prob ko lang is what if the database is open in a different timezone, dont know what will be displayed, so i guess i have to write a different code to filter or get data on the client's side..

    newbie pa kasi me sa php, 3 days running pa lang

  6.    Advertisement

Similar Threads

 
  1. help php error sending email via localhost
    By roiancuares in forum Websites & Multimedia
    Replies: 5
    Last Post: 03-07-2013, 10:50 PM
  2. Need Help!! PHP WEB TEMPLATES
    By Master ThorJack in forum Websites & Multimedia
    Replies: 10
    Last Post: 02-03-2013, 01:43 PM
  3. Need help... PHP Error
    By dezheavensent in forum Programming
    Replies: 6
    Last Post: 06-19-2009, 12:29 PM
  4. Need Help with this error message...
    By franzziss in forum Software & Games (Old)
    Replies: 2
    Last Post: 03-14-2008, 04:08 PM
  5. Need help, dll error on startup and cant delete trojan
    By Zuan in forum Software & Games (Old)
    Replies: 3
    Last Post: 03-04-2008, 10:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top