SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot allanlud's Avatar
    Join Date
    Jul 2012
    Location
    Meath, Ireland
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need Help With Simple PHP Script

    Hi all, not sure if I'm posting in the right section, I just started going through 'Build Your Own Database Driven Website Using PHP & MySQL' by Kevin Yank.

    I'm only in Chapter One and am having a small problem with the first PHP script (Date/Time). I'll post some attachments to show you, hopefully it will help. It's probably something that I haven't done.

    Any help appreciated, thanks.

    Al.
    Attached Images Attached Images

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,118
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    It looks like you typed a '1' (one) instead of 'l' (lowercase L). For more information about the date parameter string, see here

  3. #3
    SitePoint Zealot allanlud's Avatar
    Join Date
    Jul 2012
    Location
    Meath, Ireland
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Really thought that was a '1' not an L. Thanks for that. That sorts out the Day, could you tell me how I can fix the Warning?

  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,118
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Certainly, I missed your first attachment, so my apologies. But it is asking you to add this line of code:
    PHP Code:
    date_default_timezone_set('your time zone here'); 
    source | Find your Time Zone

    So the code you would end up with is:
    PHP Code:
    <?php
    date_default_timezone_set
    ('your time zone here');
    echo 
    date('l, F dS Y.');
    ?>

  5. #5
    SitePoint Zealot allanlud's Avatar
    Join Date
    Jul 2012
    Location
    Meath, Ireland
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excellent, thank you.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •