Announcement

Collapse
No announcement yet.

PHP ORM Where Clause - Date Only, Ignore Time

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • yurikuzn
    replied
    'DAYOFMONTH:createdAt' => date('Y-m-d')

    https://github.com/espocrm/documenta...expressions.md

    Leave a comment:


  • blueprint
    replied
    Resolved!

    Use the "LIKE" operator which is "*" in EspoCRM. Thus:

    Code:
    $list = $this->getEntityManager()->getRepository($entityType)->where([
    'createdAt*' => date("Y-m-d %:%:%")
    ]);
    Works just fine.
    Last edited by blueprint; 01-23-2020, 08:08 AM.

    Leave a comment:


  • blueprint
    started a topic PHP ORM Where Clause - Date Only, Ignore Time

    PHP ORM Where Clause - Date Only, Ignore Time

    How can I filter (using the EspoCRM PHP functions) a date-time field by the date only - ignoring the time part?

    Code:
    $list = $this->getEntityManager()->getRepository($entityType)->where([
    'date(createdAt)' => date("Y-m-d")
    ]);
    The above doesn't seem to work at all.
    Last edited by blueprint; 01-23-2020, 08:08 AM.
Working...
X