mypoint Posted February 9, 2013 Report Share Posted February 9, 2013 Tātad man ir šāds kods ar kuru parāda cik palicis laiks, līdz kādam datumam. $nak = mktime(0, 0, 0, $laiksm, $laiksd, $laiksg); $sod = time(); $difference = $nak - $sod; if ($difference < 0) { $difference = 0; } echo " ". floor($difference/60/60/24)." Dienas Atlikušas"; Vai ir iespējams attēlot stundas, kad beidzas pilnās dienas. Piemēram, ja laiks ir uzstādīts uz rītdienas 23:59, tad rāda jau cik atlikušas stundas, bet ja uz parītdienas tad jārāda dienas. Kā arī, kad vairs nav atlikušas stundas, lai rāda minūtes un pēctam sekundes. Vai arī tomēr jāķeras pie javascript ? Protams varētu attēlot uzreiz dienas-stundas-minūtes-sekundes, bet es jautāju tikai aiz ziņkārības. Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted February 9, 2013 Report Share Posted February 9, 2013 http://www.php.net/manual/en/datetime.diff.php Quote Link to comment Share on other sites More sharing options...
daGrevis Posted February 9, 2013 Report Share Posted February 9, 2013 Fuzzy time? Quote Link to comment Share on other sites More sharing options...
Val Posted February 11, 2013 Report Share Posted February 11, 2013 http://aidanlister.com/2004/04/making-time-periods-readable/ Quote Link to comment Share on other sites More sharing options...
daGrevis Posted February 11, 2013 Report Share Posted February 11, 2013 Vai fuzzy. Skaties, ko tev tur īsti vajag. https://github.com/apankov/fuzzy-span Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.