From 25dd5ff4359dba170bb5e8d590ebf745719312a7 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 8 Nov 2019 14:41:08 +0100 Subject: [PATCH] Timestamp: Support *about any English textual datetime description* --- library/Icingadb/Model/Behavior/Timestamp.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/Icingadb/Model/Behavior/Timestamp.php b/library/Icingadb/Model/Behavior/Timestamp.php index b2a3a2ba..73fc835f 100644 --- a/library/Icingadb/Model/Behavior/Timestamp.php +++ b/library/Icingadb/Model/Behavior/Timestamp.php @@ -13,6 +13,10 @@ class Timestamp extends PropertyBehavior public function toDb($value, $_) { + if (! ctype_digit($value)) { + $value = strtotime($value); + } + return $value * 1000.0; } }