<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */


class DateTimeOperationsMySQLi extends DateTimeOperationsServer
{
  
  public function getShortDateStr($datetimevalue)
  {
    return StringOperations::substr($datetimevalue, 8, 2) . '.' . StringOperations::substr($datetimevalue, 5, 2) . '.';
  }

  
  public function getFormatDate4Server($day, $month, $year)
  {
    return "'" . $year . '-' . $month . '-' . $day . "'";
  }

  
  
  
  public function getFormatTime4Server($minute, $hour, $day = 30, $month = 12, $year = 1899, $second = 0)
  {
    $format = "H:i'";
    if ($second !== 0) {
      $format = "H:i:s'";
    }

    return "'$year-$month-$day " . date($format, mktime($hour, $minute, $second));
    
  }

  public function getInvalidDate4Server()
  {
    return $this->getFormatDate4Server('00', '00', '0000');
  }
}