trait Difference
Trait Difference.
Depends on the following methods:
Methods
No description
Get the difference as a CarbonInterval instance.
Get the difference in years
Get the difference in quarters rounded down.
Get the difference in months rounded down.
Get the difference in weeks rounded down.
Get the difference in days rounded down.
Get the difference in days using a filter closure rounded down.
Get the difference in hours using a filter closure rounded down.
Get the difference by the given interval using a filter closure.
Get the difference in weekdays rounded down.
Get the difference in weekend days using a filter rounded down.
Get the difference in hours rounded down.
Get the difference in hours rounded down using timestamps.
Get the difference in minutes rounded down.
Get the difference in minutes rounded down using timestamps.
Get the difference in seconds rounded down.
Get the difference in microseconds.
Get the difference in milliseconds rounded down.
Get the difference in seconds using timestamps.
Get the difference in microseconds using timestamps.
Get the difference in milliseconds rounded down using timestamps.
Get the difference in seconds as float (microsecond-precision).
Get the difference in minutes as float (microsecond-precision).
Get the difference in hours as float (microsecond-precision).
Get the difference in days as float (microsecond-precision).
Get the difference in weeks as float (microsecond-precision).
Get the difference in months as float (microsecond-precision).
Get the difference in year as float (microsecond-precision).
Get the difference in seconds as float (microsecond-precision) using timestamps.
Get the difference in minutes as float (microsecond-precision) using timestamps.
Get the difference in hours as float (microsecond-precision) using timestamps.
Get the difference in days as float (microsecond-precision).
Get the difference in weeks as float (microsecond-precision).
Get the difference in months as float (microsecond-precision) using timestamps.
Get the difference in year as float (microsecond-precision) using timestamps.
The number of seconds since midnight.
The number of seconds until 23:59:59.
Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).
No description
No description
Get the difference in a human readable format in the current locale from an other instance given (or now if null given) to current instance.
No description
Get the difference in a human readable format in the current locale from current instance to now.
Get the difference in a human readable format in the current locale from an other instance given to now
Get the difference in a human readable format in the current locale from an other instance given to now
Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).
Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days, or a calendar date (e.g. "10/29/2017") otherwise.
No description
No description
No description
Details
at line42
staticprotected
fixNegativeMicroseconds(CarbonInterval$diff)
at line86
staticprotectedCarbonInterval
fixDiffInterval(DateInterval$diff,bool$absolute)
at line124
diff($date =null,$absolute =false)
at line151
CarbonInterval
diffAsCarbonInterval(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference as a CarbonInterval instance.
Return relative interval (negative if $absolute flag is not set to true and the given date is before current one).
at line164
int
diffInYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in years
at line177
int
diffInQuarters(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in quarters rounded down.
at line190
int
diffInMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in months rounded down.
at line205
int
diffInWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weeks rounded down.
at line218
int
diffInDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in days rounded down.
at line232
int
diffInDaysFiltered(Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in days using a filter closure rounded down.
at line246
int
diffInHoursFiltered(Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours using a filter closure rounded down.
at line261
int
diffFiltered(CarbonInterval$ci,Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference by the given interval using a filter closure.
at line287
int
diffInWeekdays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weekdays rounded down.
at line302
int
diffInWeekendDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weekend days using a filter rounded down.
at line317
int
diffInHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours rounded down.
at line330
int
diffInRealHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours rounded down using timestamps.
at line343
int
diffInMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in minutes rounded down.
at line356
int
diffInRealMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in minutes rounded down using timestamps.
at line369
int
diffInSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in seconds rounded down.
at line393
int
diffInMicroseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in microseconds.
at line412
int
diffInMilliseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in milliseconds rounded down.
at line425
int
diffInRealSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in seconds using timestamps.
at line442
int
diffInRealMicroseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in microseconds using timestamps.
at line460
int
diffInRealMilliseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in milliseconds rounded down using timestamps.
at line473
float
floatDiffInSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in seconds as float (microsecond-precision).
at line486
float
floatDiffInMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in minutes as float (microsecond-precision).
at line499
float
floatDiffInHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours as float (microsecond-precision).
at line512
float
floatDiffInDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in days as float (microsecond-precision).
at line534
float
floatDiffInWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weeks as float (microsecond-precision).
at line547
float
floatDiffInMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in months as float (microsecond-precision).
at line582
float
floatDiffInYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in year as float (microsecond-precision).
at line617
float
floatDiffInRealSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in seconds as float (microsecond-precision) using timestamps.
at line630
float
floatDiffInRealMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in minutes as float (microsecond-precision) using timestamps.
at line643
float
floatDiffInRealHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours as float (microsecond-precision) using timestamps.
at line656
float
floatDiffInRealDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in days as float (microsecond-precision).
at line673
float
floatDiffInRealWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weeks as float (microsecond-precision).
at line686
float
floatDiffInRealMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in months as float (microsecond-precision) using timestamps.
at line721
float
floatDiffInRealYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in year as float (microsecond-precision) using timestamps.
at line753
int
secondsSinceMidnight()
The number of seconds since midnight.
at line763
int
secondsUntilEndOfDay()
The number of seconds until 23:59:59.
at line815
string
diffForHumans(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).
at line873
string
from(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
at line884
since($other =null,$syntax =null,$short =false,$parts =1,$options =null)
at line937
string
to(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from an other instance given (or now if null given) to current instance.
When comparing a value in the past to default now: 1 hour from now 5 months from now
When comparing a value in the future to default now: 1 hour ago 5 months ago
When comparing a value in the past to another value: 1 hour after 5 months after
When comparing a value in the future to another value: 1 hour before 5 months before
at line980
string
until(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
at line1013
string
fromNow(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from current instance to now.
at line1052
string
toNow(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from an other instance given to now
at line1085
string
ago(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from an other instance given to now
at line1102
string
timespan($other =null,$timezone =null)
Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).
at line1127
string
calendar(Carbon|DateTimeInterface|string|null$referenceTime =null,array$formats =[])
Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days, or a calendar date (e.g. "10/29/2017") otherwise.
Language, date and time formats will change according to the current locale.