You are here

function date_now in Date 6.2

Same name and namespace in other branches
  1. 5.2 date_api.module \date_now()
  2. 6 date_api.module \date_now()
  3. 7.3 date_api/date_api.module \date_now()
  4. 7 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

30 calls to date_now()
DateAPITestCase::testDateAPI in tests/date_api.test
date_api_add_date_formats_form in ./date_api.admin.inc
Allow users to add additional date formats.
date_api_argument_handler::get_default_argument in includes/date_api_argument_handler.inc
Set the empty argument value to the current date, formatted appropriately for this argument.
date_api_configure_custom_date_formats in ./date_api.admin.inc
Allow users to configure custom date formats.
date_api_date_format_form_elements in ./date_api.admin.inc
Add drop down selects for date format types.

... See full list

File

./date_api.module, line 824
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 date_make_date('now', $timezone);
}