aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2003-08-30 15:54:37 +0000
committerz0rglub <z0rglub@piwigo.org>2003-08-30 15:54:37 +0000
commit044fba02566cd1854e8a1721a74552073a6ad2e3 (patch)
tree5e2960701b26c9d9a9ba6e887277a652024eb961 /include/functions.inc.php
parentb5bc93914972e247aeb6dbe3dd7e319e13f5034a (diff)
Multi categories for the same picture
git-svn-id: http://piwigo.org/svn/trunk@61 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions.inc.php')
-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