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: Time to Date

  1. #1
    New Coder
    Join Date
    Feb 2009
    Posts
    96
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Time to Date

    Hello.
    I want to turn time(); into something like "10:15" is this possible?
    Here's an example:
    PHP Code:
    //Time
    $time "1263696726";
    //Now I want to convert $time to X:XX
    //I have no idea what to do next. 
    I hope you can help, thanks!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    PHP Code:
    $time time(); // Or whatever number you want to use
    $formatted date('H:i'$time); 
    Refer to the following page to see other modifiers for date format: http://php.ca/manual/en/function.date.php
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • Users who have thanked Fou-Lu for this post:

    Crisp (01-23-2010)

  • #3
    New Coder
    Join Date
    Feb 2009
    Posts
    96
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Right before I saw this I figured it out, lol.
    Thanks anyways!


  •  

    Posting Permissions

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