westor

$nduration in $_timeago for VitruxPT

Sep 1st, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.42 KB | None | 0 0
  1. alias nduration {
  2.   if (!$1) { return 0 }
  3.   if ($1) && ($1 !isnum) { return 0 }
  4.   if ($1 >= 31557600) {
  5.     var %y = $floor($calc($1 / 31557600))
  6.     return %y year $+ $iif(%y !== 1,s) $+ $chr(44) $duration($calc($1 % 31557600))
  7.   }
  8.   if ($1 >= 2629800) {
  9.     var %m = $floor($calc($1 / 2629800))
  10.     return %m month $+ $iif(%m !== 1,s) $+ $chr(44) $duration($calc($1 % 2629800))
  11.   }
  12.   else { return $duration($1) }
  13. }
Add Comment
Please, Sign In to add comment