You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Richard edited this page Jun 16, 2016
·
1 revision
Dates
Maphper uses the inbuilt PHP \DateTime class to store and search by dates:
$blog = newstdClass;
$blog->title = 'A blog entry';
//You can construct the date object using any of the formats availble in the inbuilt PHP datetime class$blog->date = new \DateTime('2015-11-14');
This can also be used in filters:
//Find all blogs posted on 2015-11-14$maphper->filter(['date' => new \DateTime('2015-11-14')]);
It is recommended to use the DateTime class rather than passing the date value as a string as not all mappers will use the same internal date format