1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Change the time (240 seconds in display) to 2minutes : 0 seconds

Discussion in 'Development' started by Mystic30, Oct 19, 2017.

  1. Mystic30

    Mystic30 Witch

    Messages:
    52
    GitHub:
    Mystic30
    Hi, i want to know the code of changing the seconds "240" to m:s display if you know what i mean :)
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Use gmdate with $format as "i:s" and $timestamp as 240.
     
  3. Mystic30

    Mystic30 Witch

    Messages:
    52
    GitHub:
    Mystic30
    I will use it in my minigame..Can you give me a code?
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    I provided you the steps, you can figure it out.
     
    Mystic30 likes this.
  5. Mystic30

    Mystic30 Witch

    Messages:
    52
    GitHub:
    Mystic30
    I tried another code
    PHP:
    $second = ($time 170) % 60;
                                                                    
    $timer = ($time 170 $second) / 60;
                                                                    
    $min $timer 60;
                                                                    
    $sec str_pad($second2"0"STR_PAD_LEFT);
    it worked but it continues to negative :(
     
  6. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    https://en.wikipedia.org/wiki/Reinventing_the_wheel
     
  7. Mystic30

    Mystic30 Witch

    Messages:
    52
    GitHub:
    Mystic30
    Nvm..i fixed it
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.