Properties
year
month
- Returns an
int
from 1-12
, representing the month
day
hour
minute
second
timestamp
weekStartsAt
- Returns an
int
from 0-6
(0
- Sunday, 6
- Saturday)
weekEndsAt
dateString
dateTimeString
- Returns a
Y-m-d H:i:s
string
timeString
weekday
- Returns a
boolean
result if the date is a weekday date
weekend
- Returns a
boolean
result if the date is a weekend date
sunday
- Returns
true
if the date is a Sunday
- Works for all week days
monday
, tuesday
, wednesday
, etc
Methods
format
- Format the date to PHP's date formatting guidelines, e.g. -
event.startDate.format("l d, Y")
eq
- check if a date is equal to another date.
event.startDate.eq(event.endDate)
would return true if both dates would be equal
ne
- check if the dates are not equal
gt
- checks if a date is greater than the other date
event.startDate.gt(anotherEvent.startDate)
would return true only if event.startDate
were greater than anotherEvent.startDate
gte
- check for greater OR equal than
lt
lte
between
- check if a date is between two other dates
event.startDate.between(month.startDate, month.endDate)
would return true if the event.startDate
were between a given month range