Project

General

Profile

1
<?php
2
  /**
3
  * QuickSkin Extension db_datetime
4
  * Convert Oracle Date (British Format) to Local Formatted Date and Time
5
  *
6
  * Usage Example:
7
  * Content:  $template->assign('UPDATE', $result['LAST_UPDATE_DATE_TIME']);
8
  * Template: Last update: {db_datetime:UPDATE}
9
  * Result:   Last update: 30.01.2003 - 12:46:00
10
  *
11
  * @author Andy Prevost andy@codeworxtech.com - original by Philipp v. Criegern philipp@criegern.de
12
  */
13
  function qx_db_datetime ( $param ) {
14
    global $configuration;
15

    
16
    if (preg_match('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $param)) {
17
      return date( $configuration['datetime_format'],  strtotime($param) );
18
    } else {
19
      return 'Invalid date format!';
20
    }
21
  }
(15-15/43)