You are here

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

Same name and namespace in other branches
  1. 6 merci.module \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 includes/api.inc
Checks for reservation restrictions for a content type.
merci_validate_merci_reservation_date in includes/api.inc

File

includes/api.inc, line 885
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;
}