protected function timestamp($timestamp)
{
switch (true) {
case $timestamp instanceof \DateTime:
return $timestamp->getTimestamp() * 1000;
case is_numeric($timestamp) && strlen((string) $timestamp) == 10:
return $timestamp * 1000;
default:
return $timestamp;
}
}