@param \DateTimeInterface $dateTime

@return \JGI\SwedishDates\Model\Date
484014
public function getDate(\DateTimeInterface $dateTime)
    {
        $date = new Date($dateTime);
        $this->loadDay($date);

        return $date;
    }
1052094
public static function fromDateTime(\DateTimeInterface $dateTime) : LocalDateTime
    {
        return new LocalDateTime(
            LocalDate::fromDateTime($dateTime),
            LocalTime::fromDateTime($dateTime)
        );
    }
136950
public static function fromDateTime(DateTime $dateTime)
    {
        $dateTime = clone $dateTime;

        return new static($dateTime->getTimestamp() - $dateTime->setTime(0, 0, 0)->getTimestamp());
    }
738830
public function create(Event $event, DateTimeInterface $time)
    {
        return $this->cache->store($this->store)->add(
            $event->mutexName().$time->format('Hi'), true, 3600
        );
    }
593137
public static function fromNativeDateTime(\DateTime $time)
    {
        $hour   = \intval($time->format('G'));
        $minute = \intval($time->format('i'));
        $second = \intval($time->format('s'));

        return static::fromNative($hour, $minute, $second);
    }
533883
public static function getRelTime($datetime, $datetimeFrom = null)
    {
        $ret = '';
        $dateTime = self::getDateTime($datetime);
        $dateTimeFrom = self::getDateTime($datetimeFrom);
        $dateTimeSameDay = clone $dateTimeFrom;
        $dateTimeSameDay->setTime(0, 0, 0);
        $diffSec = $dateTimeFrom->getTimestamp() - $dateTime->getTimestamp();
        if ($dateTime > $dateTimeFrom) {
            // Future
            $dateTimeTest = clone $dateTimeSameDay;
            if ($dateTime < $dateTimeTest->modify('tomorrow')) {
                $ret = 'Today at '.$dateTime->format('g:ia');
            } elseif ($dateTime < $dateTimeTest->modify('+2 days')) {
                $ret = 'Tomorrow at '.$dateTime->format('g:ia');
            } else {
                $ret = $dateTime->format('F jS');
            }
        } elseif ($diffSec < 60) {
            // within a min
            $ret = 'Just now';
        } elseif ($diffSec < 3600) {
            // within an hour
            $ret = \round(($diffSec)/60) .' min ago';
        } elseif ($diffSec < 3600*6) {
            // within 6 hours
            $hrs = \round(($diffSec)/3600);
            $ret = $hrs.' '.Str::plural($hrs, 'hour').' ago';
        } elseif ($dateTime > $dateTimeSameDay) {             // since midnight so it's today
            $ret = 'Today at '.$dateTime->format('g:ia');
        } elseif ($dateTime->getTimestamp() >= $dateTimeSameDay->getTimestamp() - 86400) {
            $ret = 'Yesterday at '.$dateTime->format('g:ia');
        } elseif ($dateTime->getTimestamp() >= $dateTimeSameDay->getTimestamp() - 86400*7) {
            $ret = $dateTime->format('l \a\t g:ia');
        } elseif ($dateTime->getTimestamp() > \mktime(0, 0, 0, 1, 1)) {// since 1st Jan so it's this year
            $ret = $dateTime->format('F jS');
        } else {                                // last year..
            $ret = $dateTime->format('F jS, Y');
        }
        $ret = \str_replace(' at 12:00am', '', $ret);
        return $ret;
    }
317340
public function setLastModified(\DateTimeInterface $date = null)
    {
        if (null === $date) {
            $this->headers->remove('Last-Modified');

            return $this;
        }

        if ($date instanceof \DateTime) {
            $date = \DateTimeImmutable::createFromMutable($date);
        }

        $date = $date->setTimezone(new \DateTimeZone('UTC'));
        $this->headers->set('Last-Modified', $date->format('D, d M Y H:i:s').' GMT');

        return $this;
    }
1064420
public function transform($dateTime)
    {
        if (null === $dateTime) {
            return '';
        }

        if (!$dateTime instanceof \DateTimeInterface) {
            throw new TransformationFailedException('Expected a \DateTimeInterface.');
        }

        if ($this->inputTimezone !== $this->outputTimezone) {
            if (!$dateTime instanceof \DateTimeImmutable) {
                $dateTime = clone $dateTime;
            }

            $dateTime = $dateTime->setTimezone(new \DateTimeZone($this->outputTimezone));
        }

        return preg_replace('/\+00:00$/', 'Z', $dateTime->format('c'));
    }
725798
public static function fromNative(\DateTimeInterface $dateTime) : Date
    {
        return new self((int)$dateTime->format('Y'), (int)$dateTime->format('m'), (int)$dateTime->format('d'));
    }
200161
public function findEndBefore(\DateTime $dateTime)
    {
        return $this->createQueryBuilder('t')
            ->where('t.lastExecution IS NULL OR t.lastExecution > :dateTime')
            ->setParameter('dateTime', $dateTime)
            ->getQuery()
            ->getResult();
    }
340655
public static function asJsonApiDateTime(RuleInterface $next = null): RuleInterface
    {
        return self::stringToDateTime(DateTime::JSON_API_FORMAT, $next);
    }
318640
public function toIso8601DateTime(DateTimeInterface $dateTime, ?DateTimeZone $displayedTimeZone = null): string
    {
        if ($displayedTimeZone !== null && ($dateTime instanceof DateTime || $dateTime instanceof DateTimeImmutable)) {
            $dateTime = $dateTime->setTimezone($displayedTimeZone);
        }

        return $dateTime->format(DateTime::ATOM);
    }
521961
private function getAdoptedDateTime(DateTimeInterface $dateTime): \DateTime
    {
        return (new \DateTime())
            ->setTimestamp($dateTime->getTimestamp())
            ->setTimezone(new DateTimeZone('Asia/Manila'));
    }
1119910
public function buildDateTimeRawValue(\DateTime $dateTime = null) {
		if (null === $dateTime) return null;
		return DateUtils::formatDateTime($dateTime, MssqlDateTimeColumn::generateFormatBuildRawValue(
				MssqlDateTimeColumn::FORMAT_BUILD_TYPE_RAW_VALUE, true, true, self::COLUMN_TYPE_PRECISION, false));
	}
369461
public function day(DateTimeInterface $dateTime, string $dateFormat = 'Y-m-d, H:i'): string
	{
		if($dateTime->format('Y-m-d') === date('Y-m-d'))
		{
			return $this->i18n->get('humanizer.today');
		}
		elseif($dateTime->format('Y-m-d') === date('Y-m-d', time() - (60 * 60 * 24)))
		{
			return $this->i18n->get('humanizer.yesterday');
		}
		elseif($dateTime->format('Y-m-d') === date('Y-m-d', time() + (60 * 60 * 24)))
		{
			return $this->i18n->get('humanizer.tomorrow');
		}
		else
		{
			return $dateTime->format($dateFormat);
		}
	}
8152
public static function fromNative(\DateTimeInterface $dateTime) : TimeOfDay
    {
        return new self((int)$dateTime->format('H'), (int)$dateTime->format('i'), (int)$dateTime->format('s'));
    }
713216
public function getNamesByDate(\DateTimeInterface $date): array
    {
        return $this->names[(int)$date->format('n')][(int)$date->format('j')];
    }