You are here

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

Same name and namespace in other branches
  1. 6.2 includes/api.inc \merci_create_local_date_object()
  2. 6 merci.module \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.

4 calls to merci_create_local_date_object()
merci_check_content_type_restrictions in includes/api.inc
Checks for reservation restrictions for a content type.
merci_preprocess_merci_printable_contract in modules/merci_printable_contract/merci_printable_contract.module
merci_validate_merci_reservation_date in includes/api.inc
template_preprocess_merci_conflict_grid in theme/theme.inc
@file MERCI - Managed Equipment Reservation Checkout and Inventory

File

includes/api.inc, line 880
MERCI - Managed Equipment Reservation Checkout and Inventory

Code

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