diff --git a/docs/dev/element-queries/README.md b/docs/dev/element-queries/README.md index 1333759..256db00 100644 --- a/docs/dev/element-queries/README.md +++ b/docs/dev/element-queries/README.md @@ -124,10 +124,9 @@ For example, if you want to load entries with a custom `eventDate` field set wit ``` ```php{7} use craft\elements\Entry; -use craft\helpers\Db; -$start = Db::prepareDateForDb(new \DateTime('first day of next month')); -$end = Db::prepareDateForDb(new \DateTime('last day of next month')); +$start = new \DateTime('first day of next month')->format(\DateTime::ATOM); +$end = new \DateTime('last day of next month')->format(\DateTime::ATOM); $entries = Entry::find() ->section('events') ->eventDate(['and', ">= {$start}", "<= {$end}"])