Feature #37376

Application-wide time stamp representing "now"

Added by Robert Lemke almost 7 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Utility
Start date:
2012-05-21
Due date:
% Done:

100%

PHP Version:
5.3
Has patch:
No
Complexity:
easy

Description

We should provide an application-wide reference for a time reflecting "now" because:

  • code using time() and comparing values with other parts of the application might, in an edge case, end up with different times, although they both mean "now"
  • testing code which uses time() or new \DateTime() is cumbersome or sometimes not possible

Associated revisions

Revision 7f9fb7db (diff)
Added by Robert Lemke almost 7 years ago

[FEATURE] Introduce "Now" as unique time reference

This patch introduces a new class called "Now" which
inherits DateTime and has the scope Singleton. It can
be used in all cases where a reliably comparable value
of "now" is needed or where time needs to be mocked
in related tests.

Change-Id: I551ccab2b0f478949342ce7657ba4bcb6b7cac09
Resolves: #37376
Releases: 1.1, 1.2

Revision 87120b37 (diff)
Added by Robert Lemke almost 7 years ago

[FEATURE] Introduce "Now" as unique time reference

This patch introduces a new class called "Now" which
inherits DateTime and has the scope Singleton. It can
be used in all cases where a reliably comparable value
of "now" is needed or where time needs to be mocked
in related tests.

Change-Id: Iaf8ab7605299b4fd809161ab1f4b5b121a4dcb2d
Resolves: #37376
Releases: 1.1, 1.2

History

#1 Updated by Gerrit Code Review almost 7 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11393

#2 Updated by Gerrit Code Review almost 7 years ago

Patch set 1 for branch FLOW3-1.1 has been pushed to the review server.
It is available at http://review.typo3.org/11394

#3 Updated by Robert Lemke almost 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF