/** * Create a TimeDate object from another one, ignoring its timezone * * @param \TimeDate $from The original timestamp * @param string|null $timezone The timezone to add to the object (defaults * to the PHP's default) * @return \TimeDate */ private function createTimeDate($from, $timezone = null) { if ($from === null) { return null; } // Make sure it's a TimeDate instance $time = \TimeDate::from($from); return \TimeDate::create($time->year, $time->month, $time->day, $time->hour, $time->minute, $time->second, $timezone); }