1

daten

longmonth_en
SYNOPSIS

longmonth_en($unixtime)

DESCRIPTION
CODE
  1. function longmonth_en($unixtime) {
  2.     static $longmonthname=array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
  3.  
  4.     $month = idate('m', $unixtime);
  5.  
  6.     return $longmonthname[$month-1];
  7. }
shortmonth_en
SYNOPSIS

shortmonth_en($unixtime)

DESCRIPTION
CODE
  1. function shortmonth_en($unixtime) {
  2.     static $shortmonthname=array('jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec');
  3.  
  4.     $month = idate('m', $unixtime);
  5.  
  6.     return $shortmonthname[$month-1];
  7. }
longday_en
SYNOPSIS

longday_en($unixtime)

DESCRIPTION
CODE
  1. function longday_en($unixtime) {
  2.     static $longdayname=array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
  3.  
  4.     $weekday = idate('w', $unixtime);
  5.  
  6.     return $longdayname[$weekday];
  7. }
shortday_en
SYNOPSIS

shortday_en($unixtime)

DESCRIPTION
CODE
  1. function shortday_en($unixtime) {
  2.     static $shortdayname=array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
  3.  
  4.     $weekday = idate('w', $unixtime);
  5.  
  6.     return $shortdayname[$weekday];
  7. }
longdate_en
SYNOPSIS

longdate_en($unixtime)

DESCRIPTION
CODE
  1. function longdate_en($unixtime) {
  2.     $day = date('j', $unixtime);
  3.     $year = date('Y', $unixtime);
  4.  
  5.     $month = longmonth_en($unixtime);
  6.  
  7.     return "$month $day, $year";
  8. }
shortdate_en
SYNOPSIS

shortdate_en($unixtime)

DESCRIPTION
CODE
  1. function shortdate_en($unixtime) {
  2.     $day = date('j', $unixtime);
  3.     $year = date('Y', $unixtime);
  4.  
  5.     $month = shortmonth_en($unixtime);
  6.  
  7.     return "$day-$month-$year";
  8. }
shortdatetime_en
SYNOPSIS

shortdatetime_en($unixtime)

DESCRIPTION
CODE
  1. function shortdatetime_en($unixtime) {
  2.     $date = shortdate_en($unixtime);
  3.  
  4.     $hour = date('H', $unixtime);
  5.     $minute = date('i', $unixtime);
  6.  
  7.     return "$date ${hour}:{$minute}";
  8. }
longdatetime_en
SYNOPSIS

longdatetime_en($unixtime)

DESCRIPTION
CODE
  1. function longdatetime_en($unixtime) {
  2.     $date = longdate_en($unixtime);
  3.  
  4.     $hour = date('H', $unixtime);
  5.     $minute = date('i', $unixtime);
  6.  
  7.     return "$date ${hour}:{$minute}";
  8. }
longtime_en
SYNOPSIS

longtime_en($unixtime)

DESCRIPTION
CODE
  1. function longtime_en($d) {
  2.     if ($d < 60*60) {
  3.         return sprintf('%dm %ds', $d / 60, $d % 60);
  4.     }
  5.     else if ($d < 24*60*60) {
  6.         return sprintf('%dh %dm %ds', $d / 3600, ($d % 3600) / 60, $d % 60);
  7.     }
  8.     else {
  9.         return sprintf('%dd %dh %dm %ds', $d / 86400, ($d % 86400) / 3600, ($d % 3600) / 60, $d % 60);
  10.     }
  11. }
SEE ALSO

datefr

Comments

To add a comment, click here.