Property | Type | Description | |
---|---|---|---|
$defaultDateFormat | string | Default date format used when casting object to string. | |
$weekStartDay | integer | Starting day of the week, where 0 is Sunday and 1 is Monday. |
Method | Description | |
---|---|---|
__call ( string $method, array $parameters ) : mixed | Dynamically handle calls for date attributes and testers. | |
__construct ( string $time = null, string | DateTimeZone $timezone = null ) : void | Create a new ExpressiveDate instance. | |
__toString ( ) : string | Return the default date format when casting to string. | |
addDays ( integer $amount ) : ExpressiveDate | Add a given amount of days. | |
addHours ( integer $amount ) : ExpressiveDate | Add a given amount of hours. | |
addMinutes ( integer $amount ) : ExpressiveDate | Add a given amount of minutes. | |
addMonths ( integer $amount ) : ExpressiveDate | Add a given amount of months. | |
addOneDay ( ) : ExpressiveDate | Add one day. | |
addOneHour ( ) : ExpressiveDate | Add one hour. | |
addOneMinute ( ) : ExpressiveDate | Add one minute. | |
addOneMonth ( ) : ExpressiveDate | Add one month. | |
addOneSecond ( ) : ExpressiveDate | Add one second. | |
addOneWeek ( ) : ExpressiveDate | Add one week. | |
addOneYear ( ) : ExpressiveDate | Add one year. | |
addSeconds ( integer $amount ) : ExpressiveDate | Add a given amount of seconds. | |
addWeeks ( integer $amount ) : ExpressiveDate | Add a given amount of weeks. | |
addYears ( integer $amount ) : ExpressiveDate | Add a given amount of years. | |
copy ( ) : ExpressiveDate | Return copy of expressive date object | |
endOfDay ( ) : ExpressiveDate | Use the end of the day. | |
endOfMonth ( ) : ExpressiveDate | Use the end of the month. | |
endOfWeek ( ) : ExpressiveDate | Use the end of the week. | |
equalTo ( ExpressiveDate $date ) : boolean | Determine if date is equal to another Expressive Date instance. | |
getDate ( ) : string | Get a date string in the format of 2012-12-04. | |
getDateTime ( ) : string | Get a date and time string in the format of 2012-12-04 23:43:27. | |
getDefaultDate ( ) : string | Get a date string in the default format. | |
getDifferenceInDays ( ExpressiveDate $compare = null ) : string | Get the difference in days. | |
getDifferenceInHours ( ExpressiveDate $compare = null ) : string | Get the difference in hours. | |
getDifferenceInMinutes ( ExpressiveDate $compare = null ) : string | Get the difference in minutes. | |
getDifferenceInMonths ( ExpressiveDate $compare = null ) : string | Get the difference in months. | |
getDifferenceInSeconds ( ExpressiveDate $compare = null ) : string | Get the difference in seconds. | |
getDifferenceInYears ( ExpressiveDate $compare = null ) : string | Get the difference in years. | |
getLongDate ( ) : string | Get a date string in the format of January 31st, 1991 at 7:45am. | |
getRelativeDate ( ExpressiveDate $compare = null ) : string | Get a relative date string, e.g., 3 days ago. | |
getShortDate ( ) : string | Get a date string in the format of Jan 31, 1991. | |
getTime ( ) : string | Get a date string in the format of 07:42:32. | |
getWeekStartDay ( ) : integer | Get the starting day of the week, where 0 is Sunday and 1 is Monday | |
greaterOrEqualTo ( ExpressiveDate $date ) : boolean | Determine if date is greater than or equal to another Expressive Date instance. | |
greaterThan ( ExpressiveDate $date ) : boolean | Determine if date is greater than another Expressive Date instance. | |
isWeekday ( ) : boolean | Determine if day is a weekday. | |
isWeekend ( ) : boolean | Determine if day is a weekend. | |
lessOrEqualTo ( ExpressiveDate $date ) : boolean | Determine if date is less than or equal to another Expressive Date instance. | |
lessThan ( ExpressiveDate $date ) : boolean | Determine if date is less than another Expressive Date instance. | |
make ( string $time = null, string | DateTimeZone $timezone = null ) : ExpressiveDate | Make and return new ExpressiveDate instance. | |
makeFromDate ( integer $year = null, integer $month = null, integer $day = null, string | DateTimeZone $timezone = null ) : ExpressiveDate | Make and return a new ExpressiveDate instance with defined year, month, and day. | |
makeFromDateTime ( integer $year = null, integer $month = null, integer $day = null, integer $hour = null, integer $minute = null, integer $second = null, string | DateTimeZone $timezone = null ) : ExpressiveDate | Make and return a new ExpressiveDate instance with defined year, month, day, hour, minute, and second. | |
makeFromTime ( integer $hour = null, integer $minute = null, integer $second = null, string | DateTimeZone $timezone = null ) : ExpressiveDate | Make and return a new ExpressiveDate instance with defined hour, minute, and second. | |
minusDays ( integer $amount ) : ExpressiveDate | Minus a given amount of days. | |
minusHours ( integer $amount ) : ExpressiveDate | Minus a given amount of hours. | |
minusMinutes ( integer $amount ) : ExpressiveDate | Minus a given amount of minutes. | |
minusMonths ( integer $amount ) : ExpressiveDate | Minus a given amount of months. | |
minusOneDay ( ) : ExpressiveDate | Minus one day. | |
minusOneHour ( ) : ExpressiveDate | Minus one hour. | |
minusOneMinute ( ) : ExpressiveDate | Minus one minute. | |
minusOneMonth ( ) : ExpressiveDate | Minus one month. | |
minusOneSecond ( ) : ExpressiveDate | Minus one second. | |
minusOneWeek ( ) : ExpressiveDate | Minus one week. | |
minusOneYear ( ) : ExpressiveDate | Minus one year. | |
minusSeconds ( integer $amount ) : ExpressiveDate | Minus a given amount of seconds. | |
minusWeeks ( integer $amount ) : ExpressiveDate | Minus a given amount of weeks. | |
minusYears ( integer $amount ) : ExpressiveDate | Minus a given amount of years. | |
notEqualTo ( ExpressiveDate $date ) : boolean | Determine if date is not equal to another Expressive Date instance. | |
now ( ) : ExpressiveDate | Use the current date and time. | |
sameAs ( ExpressiveDate $date ) : boolean | Alias for ExpressiveDate::equalTo() | |
setDefaultDateFormat ( string $format ) : ExpressiveDate | Set the default date format. | |
setTimestampFromString ( string $string ) : ExpressiveDate | Sets the timestamp from a human readable string. | |
setTimezone ( string | DateTimeZone $timezone ) : ExpressiveDate | Set the timezone. | |
setWeekStartDay ( integer | string $weekStartDay ) : void | Set the starting day of the week, where 0 is Sunday and 1 is Monday. | |
startOfDay ( ) : ExpressiveDate | Use the start of the day. | |
startOfMonth ( ) : ExpressiveDate | Use the start of the month. | |
startOfWeek ( ) : ExpressiveDate | Use the start of the week. | |
today ( ) : ExpressiveDate | Use today's date and time at midnight. | |
tomorrow ( ) : ExpressiveDate | Use tomorrow's date and time at midnight. | |
yesterday ( ) : ExpressiveDate | Use yesterday's date and time at midnight. |
Method | Description | |
---|---|---|
getDateAttribute ( string $attribute ) : mixed | Get a date attribute. | |
isDateAttribute ( string $attribute ) : mixed | Syntactical sugar for determining if date object "is" a condition. | |
isFloat ( integer | float $amount ) : boolean | Determine if a given amount is a floating point number. | |
modifyDays ( integer $amount, boolean $invert = false ) : ExpressiveDate | Modify by an amount of days. | |
modifyFromInterval ( DateInterval $interval, boolean $invert = false ) : ExpressiveDate | Modify from a DateInterval object. | |
modifyHours ( integer $amount, boolean $invert = false ) : ExpressiveDate | Modify by an amount of hours. | |
modifyMinutes ( integer $amount, boolean $invert = false ) : ExpressiveDate | Modify by an amount of minutes. | |
modifyMonths ( integer $amount, boolean $invert = false ) : ExpressiveDate | Modify by an amount of months. | |
modifySeconds ( integer $amount, boolean $invert = false ) : ExpressiveDate | Modify by an amount of seconds. | |
modifyWeeks ( integer $amount, boolean $invert = false ) : ExpressiveDate | Modify by an amount of weeks. | |
modifyYears ( integer $amount, boolean $invert = false ) : ExpressiveDate | Modify by an amount of Years. | |
parseSuppliedTimezone ( string | DateTimeZone $timezone ) : DateTimeZone | Parse a supplied timezone. | |
setDateAttribute ( string $attribute, $value ) : mixed | Set a date attribute. |
public __toString ( ) : string | ||
return | string |
public addMinutes ( integer $amount ) : ExpressiveDate | ||
$amount | integer | |
return | ExpressiveDate |
public addOneHour ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public addOneMinute ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public addOneMonth ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public addOneSecond ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public addOneWeek ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public addOneYear ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public addSeconds ( integer $amount ) : ExpressiveDate | ||
$amount | integer | |
return | ExpressiveDate |
public copy ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public endOfDay ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public endOfMonth ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public endOfWeek ( ) : ExpressiveDate | ||
return | ExpressiveDate |
protected getDateAttribute ( string $attribute ) : mixed | ||
$attribute | string | |
return | mixed |
public getDateTime ( ) : string | ||
return | string |
public getDefaultDate ( ) : string | ||
return | string |
public getDifferenceInDays ( ExpressiveDate $compare = null ) : string | ||
$compare | ExpressiveDate | |
return | string |
public getDifferenceInHours ( ExpressiveDate $compare = null ) : string | ||
$compare | ExpressiveDate | |
return | string |
public getDifferenceInMinutes ( ExpressiveDate $compare = null ) : string | ||
$compare | ExpressiveDate | |
return | string |
public getDifferenceInMonths ( ExpressiveDate $compare = null ) : string | ||
$compare | ExpressiveDate | |
return | string |
public getDifferenceInSeconds ( ExpressiveDate $compare = null ) : string | ||
$compare | ExpressiveDate | |
return | string |
public getDifferenceInYears ( ExpressiveDate $compare = null ) : string | ||
$compare | ExpressiveDate | |
return | string |
public getLongDate ( ) : string | ||
return | string |
public getRelativeDate ( ExpressiveDate $compare = null ) : string | ||
$compare | ExpressiveDate | |
return | string |
public getShortDate ( ) : string | ||
return | string |
public getWeekStartDay ( ) : integer | ||
return | integer |
public greaterOrEqualTo ( ExpressiveDate $date ) : boolean | ||
$date | ExpressiveDate | |
return | boolean |
public greaterThan ( ExpressiveDate $date ) : boolean | ||
$date | ExpressiveDate | |
return | boolean |
protected isDateAttribute ( string $attribute ) : mixed | ||
$attribute | string | |
return | mixed |
public lessOrEqualTo ( ExpressiveDate $date ) : boolean | ||
$date | ExpressiveDate | |
return | boolean |
public static makeFromDateTime ( integer $year = null, integer $month = null, integer $day = null, integer $hour = null, integer $minute = null, integer $second = null, string | DateTimeZone $timezone = null ) : ExpressiveDate | ||
$year | integer | |
$month | integer | |
$day | integer | |
$hour | integer | |
$minute | integer | |
$second | integer | |
$timezone | string | DateTimeZone | |
return | ExpressiveDate |
public minusHours ( integer $amount ) : ExpressiveDate | ||
$amount | integer | |
return | ExpressiveDate |
public minusMinutes ( integer $amount ) : ExpressiveDate | ||
$amount | integer | |
return | ExpressiveDate |
public minusMonths ( integer $amount ) : ExpressiveDate | ||
$amount | integer | |
return | ExpressiveDate |
public minusOneDay ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public minusOneHour ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public minusOneMinute ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public minusOneMonth ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public minusOneSecond ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public minusOneWeek ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public minusOneYear ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public minusSeconds ( integer $amount ) : ExpressiveDate | ||
$amount | integer | |
return | ExpressiveDate |
public minusWeeks ( integer $amount ) : ExpressiveDate | ||
$amount | integer | |
return | ExpressiveDate |
public minusYears ( integer $amount ) : ExpressiveDate | ||
$amount | integer | |
return | ExpressiveDate |
protected modifyDays ( integer $amount, boolean $invert = false ) : ExpressiveDate | ||
$amount | integer | |
$invert | boolean | |
return | ExpressiveDate |
protected modifyFromInterval ( DateInterval $interval, boolean $invert = false ) : ExpressiveDate | ||
$interval | DateInterval | |
$invert | boolean | |
return | ExpressiveDate |
protected modifyHours ( integer $amount, boolean $invert = false ) : ExpressiveDate | ||
$amount | integer | |
$invert | boolean | |
return | ExpressiveDate |
protected modifyMinutes ( integer $amount, boolean $invert = false ) : ExpressiveDate | ||
$amount | integer | |
$invert | boolean | |
return | ExpressiveDate |
protected modifyMonths ( integer $amount, boolean $invert = false ) : ExpressiveDate | ||
$amount | integer | |
$invert | boolean | |
return | ExpressiveDate |
protected modifySeconds ( integer $amount, boolean $invert = false ) : ExpressiveDate | ||
$amount | integer | |
$invert | boolean | |
return | ExpressiveDate |
protected modifyWeeks ( integer $amount, boolean $invert = false ) : ExpressiveDate | ||
$amount | integer | |
$invert | boolean | |
return | ExpressiveDate |
protected modifyYears ( integer $amount, boolean $invert = false ) : ExpressiveDate | ||
$amount | integer | |
$invert | boolean | |
return | ExpressiveDate |
public notEqualTo ( ExpressiveDate $date ) : boolean | ||
$date | ExpressiveDate | |
return | boolean |
public now ( ) : ExpressiveDate | ||
return | ExpressiveDate |
protected parseSuppliedTimezone ( string | DateTimeZone $timezone ) : DateTimeZone | ||
$timezone | string | DateTimeZone | |
return | DateTimeZone |
protected setDateAttribute ( string $attribute, $value ) : mixed | ||
$attribute | string | |
return | mixed |
public setDefaultDateFormat ( string $format ) : ExpressiveDate | ||
$format | string | |
return | ExpressiveDate |
public setTimestampFromString ( string $string ) : ExpressiveDate | ||
$string | string | |
return | ExpressiveDate |
public setTimezone ( string | DateTimeZone $timezone ) : ExpressiveDate | ||
$timezone | string | DateTimeZone | |
return | ExpressiveDate |
public startOfDay ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public startOfMonth ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public startOfWeek ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public today ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public tomorrow ( ) : ExpressiveDate | ||
return | ExpressiveDate |
public yesterday ( ) : ExpressiveDate | ||
return | ExpressiveDate |
protected string $defaultDateFormat | ||
return | string |
protected int $weekStartDay | ||
return | integer |