You are here

function merci_create_local_date_object in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6

Same name and namespace in other branches
  1. 6.2 includes/api.inc \merci_create_local_date_object()
  2. 7.2 includes/api.inc \merci_create_local_date_object()

Creates a date object based on the site's local timezone.

Parameters

$datetime: A date in DATETIME format, UTC timezone.

Return value

A php date object in the site's timezone.

2 calls to merci_create_local_date_object()
merci_check_content_type_restrictions in ./merci.module
merci_node_validate in ./merci.module
Implementation of hook_validate().

File

./merci.module, line 2648
MERCI - Managed Equipment Reservation Checkout and Inventory

Code

function merci_create_local_date_object($datetime) {
  $date_object = date_create($datetime, timezone_open('UTC'));
  date_timezone_set($date_object, timezone_open(date_default_timezone_name()));
  return $date_object;
}