Ignore:
Timestamp:
Feb 10, 2013, 9:20:06 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Příprava na zrušení tabulek dokladů a jejich převedení na tabulky File a FinanceInvoice.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Database.php

    r456 r486  
    150150}
    151151
     152function TimeToMysqlDateTime($Time)
     153{
     154  if($Time == NULL) return(NULL);
     155    else return(date('Y-m-d H:i:s', $Time)); 
     156}
     157
     158function TimeToMysqlDate($Time)
     159{
     160  if($Time == NULL) return(NULL);
     161    else return(date('Y-m-d', $Time)); 
     162}
     163
     164function TimeToMysqlTime($Time)
     165{
     166  if($Time == NULL) return(NULL);
     167    else return(date('H:i:s', $Time)); 
     168}
     169
     170function MysqlDateTimeToTime($DateTime)
     171{
     172  if($DateTime == '') return(0);     
     173  $Parts = explode(' ', $DateTime);
     174  $DateParts = explode('-', $Parts[0]);
     175  $TimeParts = explode(':', $Parts[1]);
     176  $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[2], $DateParts[0]);
     177  return($Result); 
     178}
     179
     180function MysqlDateToTime($Date)
     181{
     182  if($Date == '') return(0);
     183  return(MysqlDateTimeToTime($Date.' 0:0:0')); 
     184}
     185
     186function MysqlTimeToTime($Time)
     187{
     188  if($Time == '') return(0);
     189  return(MysqlDateTimeToTime('0000-00-00 '.$Time)); 
     190}
     191
    152192?>
Note: See TracChangeset for help on using the changeset viewer.