When escaping, be sure to use single quotes to prevent characters like \n from becoming newlines.
in the "datetime" attribute you should put a machine-readable value which represent time , the best value is a full time/date with ISO 8601 ( date('c') ) ,,, the attr will be hidden from usersand it doesn't really matter what you put as a shown value to the user,, any date/time format is okay !
This is very good for SEO especially search engines like Google .
Prior to PHP 5.6.23, Relative Formats for the start of the week aligned with PHP's (0=Sunday,6=Saturday).
FMT='date', 'seconds', or 'ns' for date and time to the indicated precision.
Example: 2006-08-14 - -r, --reference=FILE display the last modification time of FILE -s, --set=STRING set time described by STRING -u, --utc, --universal print or set Coordinated Universal Time (UTC) --help display this help and exit --version output version information and exit FORMAT controls the output.
However, before PHP 5.1.0 this range was limited from to on some systems (e.g. You can prevent a recognized character in the format string from being expanded by escaping it with a preceding backslash.
If the character with a backslash is already a special sequence, you may need to also escape the backslash. Note that you should escape any other characters, as any which currently have a special meaning will produce undesirable results, and other characters may be assigned meaning in future PHP versions.
FMT='date' for date only (the default), 'hours', 'minutes', 'seconds', or 'ns' for date and time to the indicated precision.
This means that at a particular point in time, this function will return the same value in the US, Europe, India, Japan, ...date() will format a time-zone agnostic timestamp according to the default timezone set with date_default_timezone_set(...). If you want to output as UTC time use: In order to define leap year you must considre not only that year can be divide by 4!
The correct alghoritm is:if (year is not divisible by 4) then (it is a common year)else if (year is not divisible by 100) then (it is a leap year)else if (year is not divisible by 400) then (it is a common year)else (it is a leap year)So the code should look like this:if($year%4 == 0 && $year0 !
Example: 2006-08-14T- -R, --rfc-email output date and time in RFC 5322 format.
Example: Mon, -0600 --rfc-3339=FMT output date/time in RFC 3339 format.Convert seconds since the epoch (1970-01-01 UTC) to a date $ date --date='@2147483647' Show the time on the west coast of the US (use tzselect(1) to find TZ) $ TZ='America/Los_Angeles' date Show the local time for 9AM next Friday on the west coast of the US $ date --date='TZ="America/Los_Angeles" next Fri' The --date=STRING is a mostly free format human readable date string such as "Sun, -0800" or "2004-02-29 " or even "next Thursday".