You are here

function date_now in Date 7

Same name and namespace in other branches
  1. 5.2 date_api.module \date_now()
  2. 6.2 date_api.module \date_now()
  3. 6 date_api.module \date_now()
  4. 7.3 date_api/date_api.module \date_now()
  5. 7.2 date_api/date_api.module \date_now()

A date object for the current time.

Parameters

$timezone: Optional method to force time to a specific timezone, defaults to user timezone, if set, otherwise site timezone.

Return value

object date

23 calls to date_now()
DateAPITestCase::testDateAPI in tests/date_api.test
DateObject::arrayErrors in date_api/date_api.module
DateObject::forceValid in date_api/date_api.module
Convert a date part into something that will produce a valid date.
date_days_in_year in date_api/date_api.module
Identify the number of days in a year for a date.
date_day_of_week in date_api/date_api.module
Returns day of week for a given date (0 = Sunday).

... See full list

File

date_api/date_api.module, line 1282
This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

Code

function date_now($timezone = NULL) {
  return new DateObject('now', $timezone);
}