<p class="page-meta">Published <span><?php LOCAL_get_page_date('%H:%M / %e %A, %B, %Y'); ?></span></p>
<?php
setlocale(LC_ALL, 'pl-PL'); // you should probably have this in your gsconfig.php
// here are the 3.4 functions ported for local use
/**
* Get Page Date
*
* This will return the page's updated date/timestamp
*
* @since 1.0
* @uses $date
* @uses $TIMEZONE
*
* @param string $i Optional, default is "l, F jS, Y - g:i A"
* @param bool $echo Optional, default is true. False will 'return' value
* @return string Echos or returns based on param $echo
*/
function LOCAL_get_page_date($i = "l, F jS, Y - g:i A", $echo=true) {
global $TIMEZONE,$date;
if ($TIMEZONE != '') {
if (function_exists('date_default_timezone_set')) {
date_default_timezone_set($TIMEZONE);
}
}
$str = LOCAL_formatDate($i, strtotime($date));
if(!$echo) return $str;
echo $str;
}
/**
* Formated Date Output, special handling for params on windows
*
* @since 3.4
* @author cnb
*
* @param string $format A strftime or date format
* @param time $timestamp A timestamp
* @return string returns a formated date string
*/
function LOCAL_formatDate($format, $timestamp = null) {
if(!$timestamp) $timestamp = time();
if (strpos($format, '%') === false) {
$date = date($format, $timestamp);
}
else {
$hostIsWindows = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
if ($hostIsWindows) {
# fixes for Windows
$format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format); // strftime %e parameter not supported
$date = utf8_encode(strftime($format, $timestamp)); // strftime returns ISO-8859-1 encoded string
} else {
$date = strftime($format, $timestamp);
}
}
return $date;
}
?>