Skip to:

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#521 closed defect (fixed)

Audit bbPress' time functions.

Reported by: mdawaffe Owned by: mdawaffe
Milestone: 0.8 Priority: highest
Severity: normal Version: 0.7.3
Component: General - Administration Keywords:


Should be stored as GMT is DB.

Look at bb_offset_time(), bb_since(), all the filters on topic_time, time zone stuff, etc.

Change History (6)

#2 @so1o
11 years ago

look at #553

#3 @mdawaffe
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [659]) Rework time functions. Always use gmdate() never date(). gmt_offset now works as expectied - not constrained to server time. Easy to use template functions. Deprecate _date(), _timestame() functions. Fixes #521

#4 @mdawaffe
11 years ago

How it works:

Template functions

  1. Time functions return "X (hours|weeks|etc) ago" of current global object by default.
  2. Passing numeric argument returns time for object with that id.
  3. Passing date-format-string argument returns time formatted accordingly for current global.
  4. Can also pass, 'timestamp', 'since' (default), and 'mysql' for unix time, "X hours ago" or mysql formatted date.
  5. Can pass query string or array with keys: id, format, more. More returns "X hours, Y minutes" if format = 'since'.


  1. bb_since(), bb_offset_time(), bb_gmtstrtotime(), should accept unix time stamps, mysql formatted strings and some other strings.
  2. gmdate() used exclusively no more date().
  3. bb_gmtstrtotime() converts mysql dates (assumed to be GMT as all dates/times in bbPress are) into unix time stamp.
  4. bb_offset_time() filtering all echoing time functions but only actually applied by if format != 'since'.
  5. Calling bb_since() twice shouldn't break the date.
  6. echoing and returning functions both pass mysql formatted time to filters no matter what (and expect [but probably don't need] to have filters return mysql formatted dates).
  7. _bb_parse_time_function_args() and _bb_time_function_return() helper functions.

#5 @mdawaffe
11 years ago

(In [661]) deprecate get_inception(). bb_get_inception(), bb_inception(). fixes #521

#6 @mdawaffe
11 years ago

(In [666]) topic_time timestamp in header JS re #521

Note: See TracTickets for help on using tickets.