Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2012
    Posts
    85
    Thanks
    53
    Thanked 0 Times in 0 Posts

    Date() doesn't display with numbers?

    I was looking through w3schools PHP tutorial and noticed that the output of one of the examples didn't match what I got. I am running on an Apache server (localhost), so it might possibly be a settings problem or?

    http://www.w3schools.com/php/php_date.asp

    PHP Code:
    <?php
    echo date("Y/m/d") . "<br />";
    echo 
    date("Y.m.d") . "<br />";
    echo 
    date("Y-m-d");
    ?>
    The output of the code above should be something like this:
    2009/05/11

    The output I got was like this:
    2012/Jul/Thu
    Last edited by RonnyNishimoto; 07-12-2012 at 02:58 AM.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,470
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    See this:
    http://php.net/manual/en/function.date.php

    If you can't get it to display correctly, then something
    is either wrong with your script, or your server is over-riding something?

  • Users who have thanked mlseim for this post:

    RonnyNishimoto (07-12-2012)

  • #3
    New Coder
    Join Date
    Jul 2012
    Posts
    85
    Thanks
    53
    Thanked 0 Times in 0 Posts
    HOHOHOHOHOHOHOHOHOHOHO! HAHAHAHAHA

    You said something may have been wrong with my script! So I checked again!!!

    I used:
    echo date('Y/M/D');

    When it was supposed to be:
    echo date('Y/m/d');

    Sorry about that


  •  

    Posting Permissions

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