1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| Carbon::now(); Carbon::today(); Carbon::tomorrow(); Carbon::yesterday();
Carbon::parse('2018-01-01'); Carbon::parse('2018-01-01 12:00:00'); Carbon::parse('today'); Carbon::parse('2 days ago'); Carbon::parse('+3 weeks'); Carbon::parse('last friday'); Carbon::parse('Fri May 31 2019 06:50:14 GMT+0000 (UTC)')->toDateTimeString(); Carbon::createFromFormat('Y-m-d H', '1975-05-21 22')->toDateTimeString(); Carbon::createFromTimeStamp(1545800000);
$time->timestamp; $time->year; $time->month; $time->format('F'); $time->day; $time->hour; $time->minute; $time->second; $time->micro; $time->dayOfWeek; $time->dayOfYear; $time->weekOfMonth; $time->weekOfYear; $time->daysInMonth; $time->startOfDay(); $time->endOfDay(); $time->startOfWeek(); $time->endOfWeek(); $time->startOfMonth(); $time->endOfMonth();
$time->addDays(3); $time->addWeeks(3); $time->addHours(24); $time->subHours(20); $time->modify('-2 days'); $time->isWeekday(); $time->isWeekend(); $time->isYesterday(); $time->isTomorrow();
$first->eq($second); $first->ne($second); $first->gt($second); $first->gte($second); $first->lt($second); $first->lte($second);
$time->toDateTimeString(); $time->subDays(5)->diffForHumans(); $time->format('m/y')
|