/** * @param TimeZone $timeZone * * @return DayOfWeek */ public static function now(TimeZone $timeZone) { return LocalDate::now($timeZone)->getDayOfWeek(); }
/** * Returns the current year-month in the given time-zone. * * @param TimeZone $timeZone * * @return YearMonth */ public static function now(TimeZone $timeZone) { $localDate = LocalDate::now($timeZone); return new YearMonth($localDate->getYear(), $localDate->getMonth()); }
/** * Returns the current month-day. * * @param TimeZone $timeZone * * @return MonthDay */ public static function now(TimeZone $timeZone) { $date = LocalDate::now($timeZone); return new MonthDay($date->getMonth(), $date->getDay()); }
/** * @dataProvider providerNow * * @param integer $epochSecond The epoch second to set the clock to. * @param string $timeZone The time-zone to get the date in. * @param integer $year The expected year. * @param integer $month The expected month. * @param integer $day The expected day. */ public function testNow($epochSecond, $timeZone, $year, $month, $day) { $this->setClockTime($epochSecond); $this->assertLocalDateIs($year, $month, $day, LocalDate::now(TimeZone::parse($timeZone))); }
/** * @param TimeZone $timeZone * * @return Year */ public static function now(TimeZone $timeZone) { return new Year(LocalDate::now($timeZone)->getYear()); }