194 | | $days = intVal($length / (24 * 3600)); |
195 | | $hours = intVal(($length % (24 * 3600)) / 3600); |
196 | | $mins = intVal(($length % 3600) / 60); |
| 195 | $years = intVal( $length / 31556926 ); |
| 196 | $length = $length - ( $years * 31556926 ); |
| 197 | $months = intVal( $length / 2629743 ); |
| 198 | $length = $length - ( $months * 2629743 ); |
| 199 | $days = intVal( $length / 86400); |
| 200 | $length = $length - ( $days * 86400 ); |
| 201 | $hours = intVal( $length / 3600 ); |
| 202 | $length = $length - ( $hours * 3600 ); |
| 203 | $mins = intVal( $length / 60 ); |
| 204 | $ret = ''; |
| 205 | if ($years > 0) |
| 206 | $ret = tn('$1 year', '$1 years', $years); |
| 207 | if ($months > 0) |
| 208 | $ret .= ' '.tn('$1 month', '$1 months', $months); |
198 | | $ret = tn('$1 day', '$1 days', $days); |
199 | | else |
200 | | $ret = ''; |
201 | | if ($hours > 0) { |
202 | | if ($ret) |
203 | | $ret .= ' '; |
204 | | $ret .= tn('$1 hr', '$1 hrs', $hours); |
205 | | } |
206 | | if ($mins > 0) { |
207 | | if ($ret) |
208 | | $ret .= ' '; |
209 | | $ret .= tn('$1 min', '$1 mins', $mins); |
210 | | } |
211 | | return $ret; |
| 210 | $ret .= ' '.tn('$1 day', '$1 days', $days); |
| 211 | if ($hours > 0) |
| 212 | $ret .= ' '.tn('$1 hr', '$1 hrs', $hours); |
| 213 | if ($mins > 0) |
| 214 | $ret .= ' '.tn('$1 min', '$1 mins', $mins); |
| 215 | return trim($ret); |