Oihana PHP Arango

isDateString.php

Table of Contents

Functions

isDateString()  : string
Builds an AQL expression that checks whether a value is a valid date string.

Functions

isDateString()

Builds an AQL expression that checks whether a value is a valid date string.

isDateString(string $value) : string

This helper wraps the ArangoDB AQL function IS_DATESTRING(), which tests if the given value is a string that can be used in a date function.

The function returns true for properly formatted date strings (e.g. "2015", "2015-10", "2015-10-07T15:32:10Z") even if the actual date value is invalid (e.g. "2015-02-31").

Example AQL output:

IS_DATESTRING(doc.createdAt)
Parameters
$value : string

The AQL field or expression to check (e.g. 'doc.createdAt').

Tags
example
use function oihana\arango\db\functions\isDateString;

$expr = isDateString('doc.createdAt');
// Produces: 'IS_DATESTRING(doc.createdAt)'
see
https://docs.arangodb.com/stable/aql/functions/type-check-and-cast/#is_datestring
since
1.0.0
author

Marc Alcaraz

Return values
string

The AQL expression as a string (e.g. 'IS_DATESTRING(doc.createdAt)').

On this page

Search results