Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Zamiana sekund na godziny, minuty, sekundy
Killerek
post 25.06.2013, 18:38:50
Post #1





Grupa: Zarejestrowani
Postów: 89
Pomógł: 2
Dołączył: 15.12.2012

Ostrzeżenie: (10%)
X----


Witam, może ktoś mnie nakierować jak zamienić sekundy na HH:MM:SS?
Go to the top of the page
+Quote Post
zbychoCom
post 25.06.2013, 18:47:11
Post #2





Grupa: Zarejestrowani
Postów: 55
Pomógł: 9
Dołączył: 7.04.2011

Ostrzeżenie: (0%)
-----


może funkcja date() pomoże?
Go to the top of the page
+Quote Post
gothye
post 25.06.2013, 19:42:05
Post #3





Grupa: Zarejestrowani
Postów: 702
Pomógł: 65
Dołączył: 16.03.2009

Ostrzeżenie: (0%)
-----


albo znajomość matematyki i kalkulatora ,skoro minuta ma 60 sekund itd ....


--------------------
Nie udzielam pomocy poprzez PW
Go to the top of the page
+Quote Post
styryl
post 26.06.2013, 11:15:46
Post #4





Grupa: Zarejestrowani
Postów: 223
Pomógł: 27
Dołączył: 16.04.2008
Skąd: Bakutilu

Ostrzeżenie: (0%)
-----


  1.  
  2. function jakas( $sekundy ){
  3. $czas = round($sekundy);
  4. return sprintf('%02d:%02d:%02d', ($czas/3600),($czas/60%60), $czas%60);
  5. }
  6.  
Go to the top of the page
+Quote Post
rocktech.pl
post 26.06.2013, 11:30:01
Post #5





Grupa: Zarejestrowani
Postów: 587
Pomógł: 131
Dołączył: 8.02.2010

Ostrzeżenie: (0%)
-----


Witam.

  1. echo DateTime::createFromFormat('U', 12)->format('H:i:s');


--------------------
Despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo. --Brian Moore

I never go looking for a sucker. I look for a Champion and make a sucker of of him. --Amarillo Slim


Home-made : js-gui-classes | Accordion | Tabs | Carousel / php-sms-classes | Obsługa bramki SMS MultiInfo | Obsługa bramki SMS Mobiltek
Go to the top of the page
+Quote Post
Killerek
post 26.06.2013, 12:52:20
Post #6





Grupa: Zarejestrowani
Postów: 89
Pomógł: 2
Dołączył: 15.12.2012

Ostrzeżenie: (10%)
X----


Cytat(styryl @ 26.06.2013, 12:15:46 ) *
  1.  
  2. function jakas( $sekundy ){
  3. $czas = round($sekundy);
  4. return sprintf('%02d:%02d:%02d', ($czas/3600),($czas/60%60), $czas%60);
  5. }
  6.  


Dzięki działa!
Go to the top of the page
+Quote Post
gothye
post 26.06.2013, 15:11:27
Post #7





Grupa: Zarejestrowani
Postów: 702
Pomógł: 65
Dołączył: 16.03.2009

Ostrzeżenie: (0%)
-----


Gdyby Ci nikt nie napisał gotowca, pewnie byś siedział z tym do świąt wielkanocnych 2020 roku...


--------------------
Nie udzielam pomocy poprzez PW
Go to the top of the page
+Quote Post
Killerek
post 27.06.2013, 17:54:03
Post #8





Grupa: Zarejestrowani
Postów: 89
Pomógł: 2
Dołączył: 15.12.2012

Ostrzeżenie: (10%)
X----


Cytat(gothye @ 26.06.2013, 16:11:27 ) *
Gdyby Ci nikt nie napisał gotowca, pewnie byś siedział z tym do świąt wielkanocnych 2020 roku...


Masz rację ; )
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 23.04.2024 - 13:38