Examples using DateTime objects.
Simple demo outputting todays date. Note that getting todays date onle makes sense to use in API functions, as all other server pages will be cached.
Some examples on comparing date fields.