<?php

declare(strict_types=1);

namespace Autogedal\FeedMonitor\Model;

/**
 * Current time in UTC (as the rest of Magento stores dates), replaceable in tests.
 */
class Clock
{
    public function now(): int
    {
        return time();
    }

    public function format(?int $timestamp = null): string
    {
        return gmdate('Y-m-d H:i:s', $timestamp ?? $this->now());
    }
}
