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

Thread: Date Format

  1. #1
    New Coder
    Join Date
    Aug 2009
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date Format

    hi friends..,
    i want to display the time in my webpage in format dd-mm-yyyy.., hw to change yyyy-mm-dd to dd-mm-yyyy and to display in page

  • #2
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    www.php.net - search date()

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    The easiest way would be to manually format this:
    PHP Code:
    $sDate '2009-09-02';
    $sDate vsprintf('%3$s-%s-%1$s'explode('-'$sDate)); 
    Unless of course you want it to say Septemer 2, 2009 instead, in which case using date with either a strtotime or mktime and explodes is the route to go.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

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