|
@@ 187-195 (lines=9) @@
|
| 184 |
|
$this->assertSame('America/Toronto', $d->getTimezoneName()); |
| 185 |
|
} |
| 186 |
|
|
| 187 |
|
public function testTimezoneUsingString() |
| 188 |
|
{ |
| 189 |
|
$d = Date::now(); |
| 190 |
|
$d = $d->setTimezone('America/Toronto'); |
| 191 |
|
$this->assertSame('America/Toronto', $d->getTimezoneName()); |
| 192 |
|
|
| 193 |
|
$d = $d->timezone('America/Vancouver'); |
| 194 |
|
$this->assertSame('America/Vancouver', $d->getTimezoneName()); |
| 195 |
|
} |
| 196 |
|
|
| 197 |
|
public function testSetTimezoneUsingDateTimeZone() |
| 198 |
|
{ |
|
@@ 204-212 (lines=9) @@
|
| 201 |
|
$this->assertSame('America/Toronto', $d->getTimezoneName()); |
| 202 |
|
} |
| 203 |
|
|
| 204 |
|
public function testTimezoneUsingDateTimeZone() |
| 205 |
|
{ |
| 206 |
|
$d = Date::now(); |
| 207 |
|
$d = $d->setTimezone(new \DateTimeZone('America/Toronto')); |
| 208 |
|
$this->assertSame('America/Toronto', $d->getTimezoneName()); |
| 209 |
|
|
| 210 |
|
$d = $d->timezone(new \DateTimeZone('America/Vancouver')); |
| 211 |
|
$this->assertSame('America/Vancouver', $d->getTimezoneName()); |
| 212 |
|
} |
| 213 |
|
|
| 214 |
|
public function testSetTimeFromTimeString() |
| 215 |
|
{ |