Returns a formated date

formatDate($date,$opt,$locale)

$date can be (autodetected):
  • Unix timestamp
  • Any valid date
  • If empty, take current date and time and $opt can be placed here

$opt can be numeric (string):
1 (fromdb) = Default, only date in D/M/Y format
2 (todb) = MySQL format, only date
3 (fromdbh) = Date and  hour in D/M/Y H:i format
4 (todbh) = MySQL format date and hour
5 (email) = RFC2822 (email format)
6 (ref) = Only date, no separators
7 (refh) = Date and hour, no separators
8 (fromdbs) = Only date with year in short format
9 (hour) = Only hour
10 (esd) = Only date in spanish verbose format
11 (esdh) = Date and hour in spanish verbose format
12 (rsth) = MySQL format o'clock hour
13 (usdt) = Simple US date format
14 (wl) = Day of week long name
15 (ws) = Day of week short name
16 (ml) = Month long name
17 (ms) = Month short name
18 (yl) = Year long
19 (ys) = Year short
20 (mwl) = Month day + name of week day
21 (dml) = Month day + moth name long

$locale: Valid locale (empty takes default framework locale)