what is it that makes it systemic?It's a built-in PHP class. PHP has many built-in classes, just as PHP has many built-in functions. You don't have to write anything special to use the built-in language features -- just follow the directions in the manual.
format the output of the DateTime class before you attempt to utilize it in any additional syntax.Not really - the DateTime objects have methods that allow them to interact with each other. IIRC you can compare two DateTime objects with an if() statement and inequality to see if the values are in the past or future, etc. I do not recommend comparing them for equality, for reasons that are explained in the article.
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY
ASKER
<?php
class TheDate {
function __construct() {
$today=date("Y-m-d");
echo $today;
}
}
$date = new TheDate();
?>
It seems like all of that is automatically assumed simply by writing $date=new DateTime(). That's why I was wondering if it fell into a special category since you're not having to manually document a construct within the DateTime class etc.
And the other thing that I wanted to confirm is that you have to format the output of the DateTime class before you attempt to utilize it in any additional syntax.
For example, if you tried this:
$lastsyncdatetime=new DateTime();
date_add($lastsyncdatetime
That's going to fail because $lastsyncdatetime isn't a string.
In order for that computation to work (date_interval_create_from
But how and why?