aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions.inc.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 3345ef55f..e28515e91 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -349,4 +349,30 @@ function templatize_array( $array, $global_array_name, $handle )
$vtp->setGlobalVar( $handle, $value, ${$global_array_name}[$value] );
}
}
+
+function format_date( $date, $type = 'us', $show_time = false )
+{
+ global $lang;
+
+ switch ( $type )
+ {
+ case 'us' :
+ list( $year,$month,$day ) = explode( '-', $date );
+ $unixdate = mktime(0,0,0,$month,$day,$year);
+ break;
+ case 'unix' :
+ $unixdate = $date;
+ break;
+ }
+ $formated_date = $lang['day'][date( "w", $unixdate )];
+ $formated_date.= date( " j ", $unixdate );
+ $formated_date.= $lang['month'][date( "n", $unixdate )];
+ $formated_date.= date( ' Y', $unixdate );
+ if ( $show_time )
+ {
+ $formated_date.= date( ' G:i', $unixdate );
+ }
+
+ return $formated_date;
+}
?> \ No newline at end of file