Fields

By referring to the fields of objects of class date, you can retrieve the following values:

$date.month month
$date.year  year
$date.day day
$date.hour  hours
$date.minute  minutes
$date.second seconds
$date.weekday  weekday, i.e. number of day in a week (0 = Sunday, 1 = Monday, etc.)
$date.week week number in year (according to ISO 8601 standard) [3.1.5]
$date.weekyear year for this week (according to ISO 8601 standard) [3.2.2]
$date.yearday year day (0 = January 1, 1 = January 2, etc.)
$date.daylightsaving 1 - Daylight Saving Time, 0 - standard time
$date.TZ time zone; contains the value, if it was set for this date [3.1.1]

Values of fields year, month, day, hour, minute, second can be modified.

Example
$date_now[^date::now[]] 
$date_now.year<br /> 
$date_now.month
<br />
$date_now.day
<br />
$date_now.hour
<br />
$date_now.minute
<br />
$date_now.second
<br />
$date_now.weekday

As a result, an object of class
date will be created, containing current date, and the value of:

year
month
day
hour
minute
second
weekday

…will be output.


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 26.04.2017