Skip to content

DateTime::Format::* does not have format_timestamp_without_timezone m… #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: maint/0.0828xx
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/DBIx/Class/InflateColumn/DateTime.pm
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ sub register_column {
# _ic_dt_method will follow whatever the registration requests
# thus = instead of ||=
if ($data_type eq 'timestamp with time zone' || $data_type eq 'timestamptz') {
$info->{_ic_dt_method} = 'timestamp_with_timezone';
$info->{_ic_dt_method} = 'timestamp_with_time_zone';
}
elsif ($data_type eq 'timestamp without time zone') {
$info->{_ic_dt_method} = 'timestamp_without_timezone';
$info->{_ic_dt_method} = 'timestamp_without_time_zone';
}
elsif ($data_type eq 'smalldatetime') {
$info->{_ic_dt_method} = 'smalldatetime';
Expand Down
2 changes: 2 additions & 0 deletions t/inflate/datetime_pg.t
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ warnings_are {
# test 'timestamp without time zone'
my $dt = DateTime->from_epoch(epoch => time);
$dt->set_nanosecond(int 500_000_000);
$dt->set_time_zone( "Europe/Zaporozhye" );
$event->update({ts_without_tz => $dt});
$event->discard_changes;
isa_ok($event->ts_without_tz, "DateTime") or diag $event->created_on;
is($event->ts_without_tz->time_zone->name, "floating", "No specific timezone");
is($event->ts_without_tz, $dt, 'timestamp without time zone inflation');
is($event->ts_without_tz->microsecond, $dt->microsecond,
'timestamp without time zone microseconds survived');
Expand Down