HEX
Server: Apache
System: Linux vps-15179318.kohladvogados.com.br 5.14.0-611.49.2.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 30 09:05:08 EDT 2026 x86_64
User: kohlsol (1004)
PHP: 8.3.32
Disabled: NONE
Upload Files
File: /home/.cpan/build/TimeDate-2.35-0/t/rt52387.t
use strict;
use warnings;
use Test::More tests => 5;
use Date::Format qw(time2str strftime);

# RT#52387: seconds since the Epoch, UCT
{
    my $time = time;
    my @lt = localtime($time);
    is(strftime("%s", @lt), $time, "RT#52387: strftime %s returns epoch");
    is(time2str("%s", $time), $time, "RT#52387: time2str %s returns epoch");

    # strftime %s with explicit timezone must still return the same epoch —
    # %s is timezone-agnostic (Unix timestamp is always UTC-based).
    is(strftime("%s", @lt, "UTC"),   $time, "RT#52387: strftime %s with UTC tz returns epoch");
    is(strftime("%s", @lt, "+0000"), $time, "RT#52387: strftime %s with +0000 tz returns epoch");
    is(strftime("%s", @lt, "+0100"), $time, "RT#52387: strftime %s with +0100 tz returns epoch");
}