本文整理汇总了PHP中localizeDate函数的典型用法代码示例。如果您正苦于以下问题:PHP localizeDate函数的具体用法?PHP localizeDate怎么用?PHP localizeDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了localizeDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list_weeks
function list_weeks()
{
global $getdate, $this_year, $cal, $dateFormat_week_jump, $week_start_day;
ereg("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_month = $day_array2[2];
$this_year = $day_array2[1];
$check_week = strtotime($getdate);
$start_week_time = strtotime(dateOfWeek(date("Ymd", strtotime("{$this_year}-01-01")), $week_start_day));
$end_week_time = $start_week_time + 6 * 25 * 60 * 60;
do {
$weekdate = date("Ymd", $start_week_time);
$select_week1 = localizeDate($dateFormat_week_jump, $start_week_time);
$select_week2 = localizeDate($dateFormat_week_jump, $end_week_time);
if ($check_week >= $start_week_time && $check_week <= $end_week_time) {
$return .= "<option value=\"week.php?cal={$cal}&getdate={$weekdate}\" selected=\"selected\">{$select_week1} - {$select_week2}</option>\n";
} else {
$return .= "<option value=\"week.php?cal={$cal}&getdate={$weekdate}\">{$select_week1} - {$select_week2}</option>\n";
}
$start_week_time = strtotime("+1 week", $start_week_time);
$end_week_time = $start_week_time + 6 * 25 * 60 * 60;
} while (date("Y", $start_week_time) <= $this_year);
return $return;
}
示例2: makeTitle
function makeTitle($arr, $time)
{
global $timeFormat, $dateFormat_week;
$event_text = chopToWordCount(sanitizeForWeb(urldecode($arr["event_text"])), 20);
if ($time == -1) {
$start = localizeDate($dateFormat_week, $arr['start_unixtime']);
$end = localizeDate($dateFormat_week, $arr['end_unixtime'] - 60);
$title = $event_text;
if ($start != $end) {
$title .= "\n{$start} - {$end}";
}
} else {
$start = date($timeFormat, $arr['start_unixtime']);
$end = date($timeFormat, $arr['end_unixtime']);
$title = "{$start}: {$event_text}";
if ($start != $end) {
$title = "{$event_text}\n{$start} - {$end}";
}
}
if (!empty($arr['location'])) {
$title .= "\nLocation: " . chopToWordCount(sanitizeForWeb(urldecode($arr['location'])), 20);
}
if (!empty($arr['description'])) {
$title .= "\n\n" . chopToWordCount(sanitizeForWeb(urldecode($arr['description'])), 80);
}
$title = trim($title);
return $title;
}
示例3: define
define('BASE', '../');
include_once BASE . 'functions/init.inc.php';
require_once BASE . 'functions/date_functions.php';
require_once BASE . 'functions/template.php';
# information for the popup is sent via $_POST by a javascript snippet in
# in function openevent() from functions/date_functions.php
# character encoding has been problematic with popups.
$event = unserialize(stripslashes($_POST['event_data']));
$organizer = unserialize($event['organizer']);
$attendee = unserialize($event['attendee']);
$uid = stripslashes($_POST['uid']);
// Format event time
// All day
if ($_POST['time'] == -1) {
$start = localizeDate($dateFormat_week, $event['start_unixtime']);
$end = localizeDate($dateFormat_week, $event['end_unixtime'] - 60);
$event_times = $lang['l_all_day'] . " {$start}";
if ($start != $end) {
$event_times = "{$start} - {$end}";
}
} else {
$start = date($timeFormat, $event['start_unixtime']);
$end = date($timeFormat, $event['end_unixtime']);
$event_times = "{$start}";
if ($start != $end) {
$event_times = "{$start} - {$end}";
}
}
$event['event_text'] = sanitizeForWeb(urldecode($event['event_text']));
$event['description'] = sanitizeForWeb(urldecode($event['description']));
$event['location'] = sanitizeForWeb(urldecode($event['location']));
示例4: ereg
<?php
ereg("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_month = $day_array2[2];
$this_year = $day_array2[1];
$check_week = strtotime($getdate);
$start_week_time = strtotime(dateOfWeek(date("Ymd", strtotime("{$this_year}-01-01")), $week_start_day));
$end_week_time = $start_week_time + 6 * 25 * 60 * 60;
print "<select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value);\">\n";
// build the <option> tags
do {
$weekdate = date("Ymd", $start_week_time);
$select_week1 = localizeDate($dateFormat_week_jump, $start_week_time);
$select_week2 = localizeDate($dateFormat_week_jump, $end_week_time);
if ($check_week >= $start_week_time && $check_week <= $end_week_time) {
print "<option value=\"week.php?cal={$cal}&getdate={$weekdate}\" selected>{$select_week1} - {$select_week2}</option>\n";
} else {
print "<option value=\"week.php?cal={$cal}&getdate={$weekdate}\">{$select_week1} - {$select_week2}</option>\n";
}
$start_week_time = strtotime("+1 week", $start_week_time);
$end_week_time = $start_week_time + 6 * 25 * 60 * 60;
} while (date("Y", $start_week_time) <= $this_year);
// finish <select>
print "</select>";
示例5: while
}
$thisdate = $thisdate + 25 * 60 * 60;
$i++;
} while ($i < 7);
?>
</tr>
<?php
// print out the day names here
echo "<tr>";
$thisdate = $start_week_time;
$i = 0;
echo "<td class=\"dateback\" width=\"60\"><img src=\"images/spacer.gif\" width=\"1\" height=\"12\" alt=\" \"></td>";
echo "<td class=\"dateback\" width=\"1\"></td>";
do {
$thisday = date("Ymd", $thisdate);
$thisday3 = localizeDate($dateFormat_week_list, $thisdate);
echo "<td width=\"70\" colspan=\"" . $nbrGridCols[$thisday] . "\" valign=\"top\" align=\"center\" class=\"dateback\">\n";
echo "<font class=\"V9\"><a class=\"psf\" href=\"day.php?cal={$cal}&getdate={$thisday}\">{$thisday3}</a></font>\n";
echo "</td>\n";
$thisdate = $thisdate + 25 * 60 * 60;
$i++;
} while ($i < 7);
echo "</tr>";
?>
<tr>
<td width="60"><img src="images/spacer.gif" width="60" height="1" alt=" "></td>
<td width="1"></td>
<?php
$thisdate = $start_week_time;
$i = 0;
do {
示例6: strtotime
$minical_view = 'day';
}
$starttime = '0500';
$weekstart = 1;
$unix_time = strtotime($getdate);
$today_today = date('Ymd', strtotime("now + {$second_offset} seconds"));
$tomorrows_date = date('Ymd', strtotime('+1 day', $unix_time));
$yesterdays_date = date('Ymd', strtotime('-1 day', $unix_time));
$display_date = localizeDate($dateFormat_day, $unix_time);
// For the side months
ereg('([0-9]{4})([0-9]{2})([0-9]{2})', $getdate, $day_array2);
$this_day = $day_array2[3];
$this_month = $day_array2[2];
$this_year = $day_array2[1];
$parse_month = date('Ym', $unix_time);
$thisday2 = localizeDate($dateFormat_week_list, $unix_time);
$start_week_time = strtotime(dateOfWeek($getdate, $week_start_day));
$dayborder = 0;
$nbrGridCols = 1;
if (isset($master_array[$getdate])) {
foreach ($master_array[$getdate] as $ovlKey => $ovlValue) {
if ($ovlKey != '-1') {
foreach ($ovlValue as $ovl2Value) {
$nbrGridCols = kgv($nbrGridCols, $ovl2Value['event_overlap'] + 1);
}
}
}
}
include BASE . 'includes/header.inc.php';
?>
<center>
示例7: define
<?php
define('BASE', './');
$current_view = 'year';
require_once BASE . 'functions/ical_parser.php';
require_once BASE . 'functions/list_functions.php';
require_once BASE . 'functions/template.php';
ereg("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_month = $day_array2[2];
$this_year = $day_array2[1];
$next_year = strtotime("+1 year", strtotime($getdate));
$next_year = date("Ymd", $next_year);
$prev_year = strtotime("-1 year", strtotime($getdate));
$prev_year = date("Ymd", $prev_year);
$sidebar_date = localizeDate($dateFormat_week_list, strtotime($getdate));
// For the side months
ereg("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_month = $day_array2[2];
$this_year = $day_array2[1];
// select for calendars
$available = availableCalendars($username, $password, $phpiCal_config->ALL_CALENDARS_COMBINED);
$list_icals = display_ical_list($available);
$list_years = list_years();
$list_months = list_months();
$list_weeks = list_weeks();
$list_jumps = list_jumps();
$list_calcolors = '<img src="templates/' . $template . '/images/allday_dot.gif" alt=" " width="11" height="10" border="0" />' . $lang['l_all_day'] . '<br>
<img src="templates/' . $template . '/images/event_dot.gif" alt=" " width="11" height="10" border="0" />' . $lang['l_event'] . "<br>";
$list_icals_pick = display_ical_list($available, TRUE);
示例8: monthbottom
function monthbottom()
{
global $template, $getdate, $master_array, $this_year, $this_month, $cal, $timeFormat, $timeFormat_small, $dateFormat_week_list, $lang;
preg_match("!<\\!-- loop showbottomevents_odd on -->(.*)<\\!-- loop showbottomevents_odd off -->!is", $this->page, $match1);
preg_match("!<\\!-- loop showbottomevents_even on -->(.*)<\\!-- loop showbottomevents_even off -->!is", $this->page, $match2);
$loop[0] = trim($match1[1]);
$loop[1] = trim($match2[1]);
$m_start = $this_year . $this_month . '01';
$u_start = strtotime($m_start);
$i = 0;
do {
if (isset($master_array[$m_start])) {
foreach ($master_array[$m_start] as $cal_time => $event_times) {
$switch['CAL'] = $cal;
$switch['START_DATE'] = localizeDate($dateFormat_week_list, $u_start);
foreach ($event_times as $uid => $val) {
$switch['CALNAME'] = $val['calname'];
if (!isset($val['event_start'])) {
$switch['START_TIME'] = $lang['l_all_day'];
$switch['EVENT_TEXT'] = openevent($m_start, $cal_time, $uid, $val, $month_event_lines, 15, 'psf');
$switch['DESCRIPTION'] = urldecode($val['description']);
} else {
$event_start = $val['start_unixtime'];
$event_end = isset($val['display_end']) ? $val['display_end'] : $val["event_end"];
$event_start = date($timeFormat, $val['start_unixtime']);
$event_end = date($timeFormat, @strtotime($event_end));
$switch['START_TIME'] = $event_start . ' - ' . $event_end;
$switch['EVENT_TEXT'] = openevent($m_start, $cal_time, $uid, $val, 0, 15, 'psf');
$switch['DESCRIPTION'] = urldecode($val['description']);
}
if ($switch['EVENT_TEXT'] != '') {
$switch['DAYLINK'] = $m_start;
$temp = $loop[$i];
foreach ($switch as $tag => $data) {
$temp = str_replace('{' . $tag . '}', $data, $temp);
}
$middle .= $temp;
$i = $i == 1 ? 0 : 1;
}
}
}
}
$u_start = strtotime("+1 day", $u_start);
$m_start = date('Ymd', $u_start);
$check_month = date('m', $u_start);
unset($switch);
} while ($this_month == $check_month);
$this->page = preg_replace('!<\\!-- loop showbottomevents_odd on -->(.*)<\\!-- loop showbottomevents_even off -->!is', $middle, $this->page);
}
示例9: define
define('BASE', './');
$current_view = 'year';
require_once BASE . 'functions/ical_parser.php';
require_once BASE . 'functions/list_functions.php';
require_once BASE . 'functions/template.php';
header("Content-Type: text/html; charset={$charset}");
ereg("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_month = $day_array2[2];
$this_year = $day_array2[1];
$next_year = strtotime("+1 year", strtotime($getdate));
$next_year = date("Ymd", $next_year);
$prev_year = strtotime("-1 year", strtotime($getdate));
$prev_year = date("Ymd", $prev_year);
$sidebar_date = localizeDate($dateFormat_day, strtotime($getdate));
// For the side months
ereg("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_month = $day_array2[2];
$this_year = $day_array2[1];
// select for calendars
$list_icals = display_ical_list(availableCalendars($username, $password, $ALL_CALENDARS_COMBINED));
$list_years = list_years();
$list_months = list_months();
$list_weeks = list_weeks();
$list_jumps = list_jumps();
$list_calcolors = '<img src="templates/' . $template . '/images/allday_dot.gif" alt=" " width="11" height="10" border="0" />' . $lang['l_all_day'] . '<br>
<img src="templates/' . $template . '/images/event_dot.gif" alt=" " width="11" height="10" border="0" />' . $lang['l_event'] . "<br>";
$list_icals_pick = display_ical_list(availableCalendars($username, $password, $ALL_CALENDARS_COMBINED), TRUE);
// login/logout
示例10: while
if ($checkagain != $minical_month) {
$whole_month = FALSE;
}
}
} while ($whole_month == TRUE);
?>
</table>
<img src="images/spacer.gif" width="1" height="3" alt=" "><br>
</td>
</tr>
</table>
<img src="images/spacer.gif" width="1" height="10" alt=" "><br>
<table width="170" border="0" cellpadding="3" cellspacing="0" class="calborder">
<tr height="20">
<td align="center" class="sideback"><font class="G10BOLD"><?php
print localizeDate($dateFormat_month, strtotime("+1 month", strtotime($getdate)));
?>
</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" align="center">
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<?php
$start_day = strtotime($week_start_day);
echo '<tr>';
for ($i = 0; $i < 7; $i++) {
$day_num = date("w", $start_day);
$day = $daysofweekreallyshort_lang[$day_num];
echo '<td align="center" class="G10BOLD">' . $day . '</td>';
$start_day = strtotime("+1 day", $start_day);
}
示例11: date
<td width="210" valign="top" align="left">
<table border="0" width="210" cellspacing="0" cellpadding="0" class="calborder">
<tr>
<td colspan="7">
<table border="0" width="210" cellspacing="0" cellpadding="0">
<tr>
<td width="1" class="sideback"><img src="images/spacer.gif" width="1" height="20" alt=" "></td>
<?php
$monthlink = date("Ym", $startYear);
$monthlink = $monthlink . $this_day;
?>
<td align="center" class="sideback"><?php
echo '<a class="ps3" href="month.php?cal=' . $cal . '&getdate=' . $monthlink . '">';
?>
<font class="G10BOLD"><?php
print localizeDate($dateFormat_month, $startYear);
?>
</font></a></td>
<td width="1" class="sideback"></td>
</tr>
</table>
</td>
</tr>
<tr>
<?php
$start_day = strtotime($week_start_day);
for ($i = 0; $i < 7; $i++) {
$day_num = date("w", $start_day);
$day = $daysofweekshort_lang[$day_num];
print '<td width="30" height="14" class="dateback" align="center"><font class="V9BOLD">' . $day . '</font></td>' . "\n";
$start_day = strtotime("+1 day", $start_day);
示例12: elseif
$week_end = '';
} elseif ($printview == 'week') {
$start_week = localizeDate($dateFormat_week, $start_week_time);
$end_week = localizeDate($dateFormat_week, $end_week_time);
$display_date = "{$start_week} - {$end_week}";
$week_start = date("Ymd", $start_week_time);
$week_end = date("Ymd", $end_week_time);
$next = date("Ymd", strtotime("+1 week", $unix_time));
$prev = date("Ymd", strtotime("-1 week", $unix_time));
} elseif ($printview == 'month') {
$display_date = localizeDate($dateFormat_month, strtotime($getdate));
$next = date("Ymd", strtotime("+1 month", $unix_time));
$prev = date("Ymd", strtotime("-1 month", $unix_time));
$week_start = '';
$week_end = '';
} elseif ($printview == 'year') {
$display_date = localizeDate($dateFormat_year, strtotime($getdate));
$next = date("Ymd", strtotime("+1 year", $unix_time));
$prev = date("Ymd", strtotime("-1 year", $unix_time));
$week_start = '';
$week_end = '';
}
require_once BASE . 'functions/ical_parser.php';
require_once BASE . 'functions/list_functions.php';
require_once BASE . 'functions/template.php';
header("Content-Type: text/html; charset={$phpiCal_config->charset}");
$page = new Page(BASE . 'templates/' . $template . '/print.tpl');
$page->replace_files(array('header' => BASE . 'templates/' . $phpiCal_config->template . '/header.tpl', 'footer' => BASE . 'templates/' . $phpiCal_config->template . '/footer.tpl', 'sidebar' => BASE . 'templates/' . $phpiCal_config->template . '/sidebar.tpl'));
$page->replace_tags(array('version' => $phpiCal_config->phpicalendar_version, 'event_js' => '', 'charset' => $phpiCal_config->charset, 'default_path' => $phpiCal_config->default_path, 'default_view' => $phpiCal_config->default_view, 'template' => $phpiCal_config->template, 'cpath' => $phpiCal_config->cpath, 'cal' => $cal, 'getdate' => $getdate, 'calendar_name' => $cal_displayname, 'current_view' => $current_view, 'printview' => $printview, 'display_date' => $display_date, 'sidebar_date' => @$sidebar_date, 'rss_powered' => $rss_powered, 'rss_available' => '', 'rss_valid' => '', 'show_search' => '', 'next_day' => @$next_day, 'prev_day' => @$prev_day, 'show_goto' => '', 'is_logged_in' => '', 'list_icals' => @$list_icals, 'list_years' => @$list_years, 'list_months' => @$list_months, 'list_weeks' => @$list_weeks, 'list_jumps' => @$list_jumps, 'legend' => @$list_calcolors, 'style_select' => @$style_select, 'l_time' => $lang['l_time'], 'l_summary' => $lang['l_summary'], 'l_description' => $lang['l_description'], 'l_calendar' => $lang['l_calendar'], 'l_view_calendars' => $lang['l_view_calendars'], 'l_day' => $lang['l_day'], 'l_week' => $lang['l_week'], 'l_month' => $lang['l_month'], 'l_year' => $lang['l_year'], 'l_location' => $lang['l_location'], 'l_subscribe' => $lang['l_subscribe'], 'l_download' => $lang['l_download'], 'l_no_results' => $lang['l_no_results'], 'l_powered_by' => $lang['l_powered_by'], 'l_this_site_is' => $lang['l_this_site_is']));
$page->draw_print($page);
$page->output();
示例13: fetch_assoc
function fetch_assoc()
{
$row = $this->resultSet->fetch_assoc();
if (is_array($row) && isset($_SESSION['sessionTimeZone'])) {
foreach ($row as $key => $value) {
// check if value matches datetime format. Convert to local timezone
if (isDateTime($value)) {
$row[$key] = localizeDate($value, $_SESSION['sessionTimeZone']);
}
}
}
return $row;
}
示例14: define
define('BASE', './');
$current_view = 'day';
require_once BASE . 'functions/ical_parser.php';
require_once BASE . 'functions/list_functions.php';
require_once BASE . 'functions/template.php';
header("Content-Type: text/html; charset={$charset}");
if ($minical_view == 'current') {
$minical_view = 'day';
}
$weekstart = 1;
$unix_time = strtotime($getdate);
$today_today = date('Ymd', time() + $second_offset);
$next_day = date('Ymd', strtotime("+1 day", $unix_time));
$prev_day = date('Ymd', strtotime("-1 day", $unix_time));
$display_date = localizeDate($dateFormat_day, $unix_time);
$sidebar_date = localizeDate($dateFormat_week_list, $unix_time);
$start_week_time = strtotime(dateOfWeek($getdate, $week_start_day));
// select for calendars
$list_icals = display_ical_list(availableCalendars($username, $password, $ALL_CALENDARS_COMBINED));
$list_years = list_years();
$list_months = list_months();
$list_weeks = list_weeks();
$list_jumps = list_jumps();
$list_calcolors = list_calcolors();
$list_icals_pick = display_ical_list(availableCalendars($username, $password, $ALL_CALENDARS_COMBINED), TRUE);
// login/logout
$is_logged_in = $username != '' && !$invalid_login ? true : false;
$show_user_login = !$is_logged_in && $allow_login == 'yes';
$login_querys = login_querys();
$logout_querys = logout_querys();
$page = new Page(BASE . 'templates/' . $template . '/day.tpl');
示例15: icalToArray
//.........这里部分代码省略.........
$freq_type = 'month';
break;
case 'WEEKLY':
$freq_type = 'week';
break;
case 'DAILY':
$freq_type = 'day';
break;
case 'HOURLY':
$freq_type = 'hour';
break;
case 'MINUTELY':
$freq_type = 'minute';
break;
case 'SECONDLY':
$freq_type = 'second';
break;
}
$master_array[$start_date][$hour . $minute][$uid]['recur'][$key] = strtolower($val);
break;
case 'COUNT':
$count = $val;
$master_array[$start_date][$hour . $minute][$uid]['recur'][$key] = $count;
break;
case 'UNTIL':
$until = str_replace('T', '', $val);
$until = str_replace('Z', '', $until);
if (strlen($until) == 8) {
$until = $until . '235959';
}
$abs_until = $until;
ereg('([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})', $until, $regs);
$until = mktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]);
$master_array[$start_date][$hour . $minute][$uid]['recur'][$key] = localizeDate($dateFormat_week, $until);
break;
case 'INTERVAL':
if ($val > 0) {
$number = $val;
$master_array[$start_date][$hour . $minute][$uid]['recur'][$key] = $number;
}
break;
case 'BYSECOND':
$bysecond = $val;
$bysecond = split(',', $bysecond);
$master_array[$start_date][$hour . $minute][$uid]['recur'][$key] = $bysecond;
break;
case 'BYMINUTE':
$byminute = $val;
$byminute = split(',', $byminute);
$master_array[$start_date][$hour . $minute][$uid]['recur'][$key] = $byminute;
break;
case 'BYHOUR':
$byhour = $val;
$byhour = split(',', $byhour);
$master_array[$start_date][$hour . $minute][$uid]['recur'][$key] = $byhour;
break;
case 'BYDAY':
$byday = $val;
$byday = split(',', $byday);
$master_array[$start_date][$hour . $minute][$uid]['recur'][$key] = $byday;
break;
case 'BYMONTHDAY':
$bymonthday = $val;
$bymonthday = split(',', $bymonthday);
$master_array[$start_date][$hour . $minute][$uid]['recur'][$key] = $bymonthday;
break;