You are here

function _office_hours_mil_to_tf in Office Hours 6

Same name and namespace in other branches
  1. 6.2 office_hours.module \_office_hours_mil_to_tf()
4 calls to _office_hours_mil_to_tf()
theme_office_hours_formatter_default in ./office_hours.theme.inc
Theme function for 'default' text field formatter.
theme_office_hours_formatter_grouped in ./office_hours.theme.inc
Theme function for 'grouped' text field formatter. johnv 4/4/2012: this function is a partial backport from the D7-formatter options the code is copied, but the options are fixed.
_office_hours_convert_to_ampm in ./office_hours.module
Helper function for conversion of clock format.
_office_hours_return_defaults in ./office_hours.module

File

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

Code

function _office_hours_mil_to_tf($time = '') {
  if (strlen($time) == 2) {
    $time = $time . '00';
  }
  $hour = substr($time, 0, -2) ? substr($time, 0, -2) : '0';
  $min = substr($time, -2) ? substr($time, -2) : '00';
  return $hour . ":" . $min;
}