Here it is in a hook. Use it with $pages->get(1234)->setPublished($timestamp), where you can get timestamp using strtotime or edit hook to build a date formatted as Y-m-d h:i:s wire()->addHookMethod('Page::setPublished', function (HookEvent $e) { $page = $e->object; $timestamp = $e->arguments(0); if (!$page->id) return false; if (!$timestamp) return false; $date = date('Y-m-d h:i:s', $timestamp); $query = $e->database->prepare("UPDATE pages SET published=:pub_date WHERE id=:page_id"); $e->return = $query->execute([ ':pub_date' => $date, ':page_id' => $page->id ]); });  
    • Like
    4