Skip to content

Commit f834815

Browse files
committed
change to use date_default_timezone_set
1 parent 528b92b commit f834815

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ext/intl/tests/dateformat_format_relative.phpt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ intl
55
--FILE--
66
<?php
77

8+
date_default_timezone_set('America/Los_Angeles');
9+
810
printFormat(IntlDateFormatter::RELATIVE_FULL, IntlDateFormatter::NONE, getYesterday());
911
printFormat(IntlDateFormatter::RELATIVE_LONG, IntlDateFormatter::NONE, getYesterday());
1012
printFormat(IntlDateFormatter::RELATIVE_MEDIUM, IntlDateFormatter::NONE, getYesterday());
@@ -38,19 +40,19 @@ function printFormat(int $dateFormat, int $timeFormat, DateTimeImmutable $time)
3840
}
3941

4042
function getToday(): DateTimeImmutable {
41-
return new DateTimeImmutable("now", new DateTimeZone("America/Los_Angeles"));
43+
return new DateTimeImmutable();
4244
}
4345

4446
function getYesterday(): DateTimeImmutable {
45-
return new DateTimeImmutable("-1 day", new DateTimeZone("America/Los_Angeles"));
47+
return new DateTimeImmutable("-1 day");
4648
}
4749

4850
function getTomorrow(): DateTimeImmutable {
49-
return new DateTimeImmutable("+1 day", new DateTimeZone("America/Los_Angeles"));
51+
return new DateTimeImmutable("+1 day");
5052
}
5153

5254
function getDayInPast(): DateTimeImmutable {
53-
return new DateTimeImmutable("2020-01-20 20:20:20", new DateTimeZone("America/Los_Angeles"));
55+
return new DateTimeImmutable("2020-01-20 20:20:20");
5456
}
5557

5658
?>

0 commit comments

Comments
 (0)