Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 646 Bytes

date_time_adapter.md

File metadata and controls

26 lines (16 loc) · 646 Bytes

DateTimeAdapter

The DateTimeAdapter transforms the input value from a string into it's (possibly formatted) DateTime(Immutable) representation.

Ex. The string '<datetime("2023-06-01", format: "d/m/Y")>' will be transformed into '01/06/2023'.

Usage

<?php

use Presta\BehatEvaluator\Adapter\DateTimeAdapter;

$evaluate = new DateTimeAdapter();
$value = $evaluate('<datetime_immutable("tomorrow")>');

// $value is equal to `new \DateTimeImmutable('tomorrow')`

You may return to the README or read other adapters guides.