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
    Regular Coder
    Join Date
    Jan 2008
    Posts
    334
    Thanks
    9
    Thanked 0 Times in 0 Posts

    time() converter

    I've looked around and I can't seem to find any function that will convert a unix time stamp into readable time. The time formart I was wanting is:

    Code:
    date(h.i.s).
    Reason why is that I am working on a ajax chat system and one of the things that I was adding to this chat system is a way to mute other people for 30 minutes say if they are being offensive or whatever be the reason. When the user gets muted I wanted to have a way to tell them what time it will be that the mute will be lifted. Right now when you apply a mute in the chat system it uses the time() to figure out how long it has been and after 30 minutes there is a script that runs that lifts the mute. But all of that is beside the point. The question at hand is, is there a built in PHP function that will format the unix time into readable time?


    Thanks for the help,
    Jon W

  • #2
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    date()

    date("h:i:s", $timesamp); will work;

  • #3
    Regular Coder
    Join Date
    Jan 2008
    Posts
    334
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Thanks man!


  •  

    Posting Permissions

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