public function testToString()
{
ob_start();
echo Time::get('2002-02-02 02:02:02', 'UTC');
$output = ob_get_clean();
$this->assertSame('1012615322', $output);
$this->assertNotSame(1012615322, $output);
// Dates with no unix timestamp representation
// Before 1970
$output = (string) Time::get('1000-02-02 02:02:02', 'UTC');
$this->assertSame('-30607451878', $output);
// After 2038
$time = Time::get('3000-02-02 02:02:02', 'UTC');
$output = (string) $time;
$this->assertSame('32506452122', $output);
// Move 1000 years back to get a valid unix timestamp
$time = $time->minus('1000 years');
$output = (string) $time;
$this->assertSame('949456922', $output);
// Set a a different timezone, unix timestamp should be the same (always in UTC)
$time2 = clone $time;
$time2->setTimeZone('Indian/Christmas');
$this->assertSame((string) $time, (string) $time2);
// Try unix timestamp in different timezones
$time = Time::get('2001-12-12 21:34:18', 'UTC');
$time2 = Time::get('2001-12-12 19:34:18', 'Etc/GMT+2');
// The time is set back 2 hours to get the same UTC time
$this->assertSame((string) $time, (string) $time2);
// Change one timezone and try again
$time2->setTimeZone('America/Santiago');
$this->assertSame((string) $time, (string) $time2);
}