You are here

function _office_hours_time_format in Office Hours 7

Helper function to convert a time to a given format.

For formatting options, see http://www.php.net/manual/en/function.date.php

3 calls to _office_hours_time_format()
theme_office_hours_time_range in includes/office_hours.theme.inc
Theme function for formatter: time ranges.
_office_hours_convert_to_ampm in ./office_hours.module
Helper function to convert '1630' or '16:30' to '4:30 pm'.
_office_hours_field_widget_time_parse in ./office_hours.module

File

./office_hours.module, line 151
Creates a field and widget for inserting working or office hours per day

Code

function _office_hours_time_format($time, $timeformat) {
  $date = new DateTime(_office_hours_time_to_24hr($time));
  return $date
    ->format($timeformat);
}