Unclassified NewsBoard Code Reference

UnbFriendlyDate function

Format a date/time more user-friendly using fuzzy words and such

function UnbFriendlyDate ($date = null, $level = 1, $opt = 1, $tonow = true, $grammar = 1);

Parameters:

date  –  optional, default: null
(int) timestamp
level  –  optional, default: 1
(int) 1: only today/yesterday, 2+: longer time intervals, 3: seconds/mins/hours
opt  –  optional, default: 1
see UnbFormatTime function above
tonow  –  optional, default: true
(bool) true: compare time to now, false: $date is already a time difference (in seconds)
grammar  –  optional, default: 1
(int) 1: timespan past-now
2: timespan present
3: point of time in future
4: point of time in past

Return value:

(string) formatted date/time

Implementation file: unb_lib/common.lib.php, line 2469

© 2006 Yves Goergen. Unclassified NewsBoard Homepage. Reference based on UNB unb.devel.20060128, dated 2006-01-28.