You are here

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

Same name and namespace in other branches
  1. 6.2 includes/api.inc \merci_format_time()
  2. 6 merci.module \merci_format_time()

Formats a time value into the site's preferred format.

Parameters

object $hours_minutes: A string of the form 'H:MM' or 'HH:MM'

Return value

A string in 12- or 24-hour format with no leading zero.

1 call to merci_format_time()
merci_validate_merci_reservation_date in includes/api.inc

File

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

Code

function merci_format_time($hours_minutes) {
  $return = date(merci_time_format(), strtotime($hours_minutes));
  if ($return[0] == '0') {
    return substr($return, 1);
  }
  return $return;
}