本文整理汇总了PHP中Time::setTimeZoneDateTime方法的典型用法代码示例。如果您正苦于以下问题:PHP Time::setTimeZoneDateTime方法的具体用法?PHP Time::setTimeZoneDateTime怎么用?PHP Time::setTimeZoneDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Time
的用法示例。
在下文中一共展示了Time::setTimeZoneDateTime方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
case "dateTime":
if ($version == 1) {
// print ids
// echo " ids " . $_GET['invitedIds'];
// convert string ids to array
// $idArray = explode(',', $_GET['invitedIds']);
//set timezone to get the time
foreach ($idArray as $id) {
// print the specific time
echo " {$id} time server " . $mc->date_time;
//setting first day of the first time send required: dateTime
//get the specific timezone of the user
$timezone = $lookBookDatabase->getUserTimeZone($id);
echo "<br>this is time zone {$timezone} <br>";
//set timezone to get the time
$time->setTimeZoneDateTime($timezone);
//concat server date and send time
$dateTime = $time->concatDateAndTime($time->getTimezoneDate(), $time->getTimeRemoveDate($_GET['dateTime']));
echo "Send time " . $dateTime;
echo "Server Date Timezone = " . $time->getTimezoneDate();
//convert the time string send from the admin to date
$dateTime = date('Y-m-d H:i:s', strtotime($dateTime));
$location = 'BRISBANE';
//add dateTimeSend from 1 - 4 dates
$response = $time->addDateTmeSend($dateTime, $time->getTimeZoneDateTime24(), $id, $database, $invited_status);
}
} else {
$time->setTimeZoneDateTime($timezone);
//concat server date and send time
$dateTime = $time->concatDateAndTime($time->getTimezoneDate(), $time->getTimeRemoveDate($_GET['dateTime']));
echo "Send time " . $dateTime;
示例2: print_invited_people
public function print_invited_people($invited, $status = null, $header, $invited1 = null, $database = null)
{
$sc = new scrape();
$c = 0;
/*
* set timezone retrieved
* it needs to be used just once the site is loaded because maybe it can cause time
* consuming when loading iniitialized value is to set that the code will be executed only of the tab is approved and pending with email
*/
// if($invited[0]['invited_status']==0||$invited[0]['invited_status']==1):
// $Time['EST']= $sc->retrieve_time_from_timezone('EST');
// $Time['UTC']= $sc->retrieve_time_from_timezone('UTC');
// $Time['BRST']= $sc->retrieve_time_from_timezone('BRST');
// endif;
/*
* loop starts here for the executing the entire code
* of the results
*/
for ($i = 0; $i < count($invited); $i++) {
$invited_id = $invited[$i]['invited_id'];
$fullname = $invited[$i]['invited_fn'];
$invited_email = $invited[$i]['invited_email'];
$description = $invited[$i]['description'];
$invited_date = $invited[$i]['invited_date'];
$invited_status = $invited[$i]['invited_status'];
$city = $invited[$i]['city'];
$state = $invited[$i]['state'];
$country = $invited[$i]['country'];
$tlook = $invited[$i]['tlook'];
$temail_sent = $invited[$i]['temail_sent'];
$page = $invited[$i]['page'];
$timezone = $invited[$i]['timezone'];
$timezone_url = $invited[$i]['timezone_url'];
$location = $invited[$i]['location'];
$domain_source = $invited[$i]['domain_source'];
$gender = $invited[$i]['gender'];
$invited_wob = $invited[$i]['invited_wob'];
$timezoneName = $invited[$i]['timezone'];
$invited_update_date = $invited[$i]['invited_update_date'];
$DateTimeSend = $invited[$i]['DateTimeSend'];
/**
* set activity action
**/
$invited1->_setActivity($invited_id, $database);
/*
* get the scrape page
*/
$scrape_src = str_replace('http://lookbook.nu/search/users?page=', '', $invited[$i]['scrape_src']);
$interval_time_send = !empty($invited['interval_time_send']) ? intval($invited['interval_time_send']) : $_SESSION['days'];
// interval day of sending the email if null then the interval day automatically set to 7 means if 7 day come and user didnt able to sign fs then the email automatically send next email
/*
* This is to set only show the timezone in the pending with email
* and approved tab
*/
// if($invited[0]['invited_status']==0||$invited[0]['invited_status']==1):
// if ( $timezoneName == 'EST' ) {
// $Time['TimeZone']=$Time['EST'];
// }else if ( $timezoneName == 'UTC' ) {
// $Time['TimeZone']=$Time['UTC'];
// }else if ( $timezoneName == 'BRST' ) {
// $Time['TimeZone']=$Time['BRST'];
// }else{
// $Time['TimeZone']=null;
// }
// endif;
/*
* set the border of the column
*/
// $Time['BRST']= $sc->retrieve_time_from_timezone('BRST');
// preg_replace("/[^A-Z^a-z]/", "", $location)
// setTimeZone($location);
//$sc->get_time_zone_time($timezone_url,$this);
//$Time['TimeZone'] = Time::$dataTime12;
Time::setTimeZoneDateTime($timezone);
$Time['TimeZone'] = Time::getTimeZoneTime12();
// Time::$Time12 = $hour;
$c++;
// condition for the border colors
$style = '';
if ($invited_status == 0) {
// person info pending
// $(container_id).css('border','1px solid red');
$style = 'border:0px solid red';
$date = $invited_status;
} else {
if ($invited_status == 1) {
// person info is approved
$style = 'border:0px solid green';
} else {
if ($invited_status == 2) {
// show popup for edit because edit is selected
// alert( 'show popup edit' );
} else {
if ($invited_status == 3) {
// deleted
$style = 'border:0px solid yellow';
} else {
if ($invited_status == 4) {
// deleted
$style = 'border:0px solid blue';
//.........这里部分代码省略.........
示例3:
$url='www.fashionsponge.com/index.php';
$sc->get_site_last_update($url);
if(mysql_query("DELETE FROM fs_test WHERE group_id NOT IN (SELECT max(id) FROM fs_test WHERE GROUP BY group_id); ")) {
echo "deleted ";
} else {
echo "not deleted";
}
echo "<div style='display:none'>";
Time::setTimeZoneDateTime('PHT');
echo 'Time' . Time::getTimeZoneDateTime12() . '<br>';
echo 'Time' . Time::getTimeZoneDateTime24() . '<br>';
echo 'Time' . Time::getTimeZoneLocation() . '<br>';
echo "date" . Time::getTimezoneDate() . '<br>';
// break;
// case 'MONTREAL':
// $url='http://www.timeanddate.com/worldclock/canada/montreal';
// $timezone='EST';
// break;
// $location = 'BANGKOK';
// $timezone='ICT';
// $url='http://www.timeanddate.com/worldclock/thailand/bangkok';
示例4: elseif
echo "email send v1 \n<br>";
} elseif ($invited->getTotalEmailSent_() == 2) {
//send email version2
echo "email send v2 \n<br>";
} elseif ($invited->getTotalEmailSent_() == 3) {
//send email version3
echo "email send v3 \n<br>";
} else {
echo "Error\n<br>";
}
echo "{$counter}.) \n";
$alert->alert("Location Info ", $invitedLocation->setInvitedLocationInfo($locationId, $database), " set qid = {$qId} <br>\n");
//set invited info
$alert->alert("invited ", $invited->setInvitedInfoById($iId, $database), " set iId = {$iId} <br>\n");
//set time zone
$alert->alert("Time ", Time::setTimeZoneDateTime($invited->getTimeZone()), " set timezone = " . $invited->getTimeZone() . " <br>\n");
//if the total sent email is greater than 3 then it should invited email should not received an invited
if ($invited->getTotalEmailSent_() <= 2) {
//condition combine queue date and specific location time
if ($invited->getTotalEmailSent_() == 0) {
$dateTime = $date1 . ' ' . $invitedLocation->getLocationTime1();
echo "send new email v1 set date <br>\n";
} elseif ($invited->getTotalEmailSent_() == 1) {
$dateTime = $date2 . ' ' . $invitedLocation->getLocationTime2();
echo "send new email v2 set date <br>\n";
} elseif ($invited->getTotalEmailSent_() == 2) {
$dateTime = $date3 . ' ' . $invitedLocation->getLocationTime3();
echo "send new email v3 set date <br>\n";
} else {
echo "\n else no send new email total sent is greater than 2 and value i" . $invited->getTotalEmailSent_();
}
示例5: array
</thead>
<tbody>
<?php
$not_accepted = array('WIB', 'A', 'ACDT', 'AEST', 'WITA', 'AWST');
$dateTime = 'not allowed';
$style = '';
for ($i = 0; $i < count($locations); $i++) {
$id = $locations[$i]['fs_invited_location_id_pk'];
$name = $locations[$i]['fs_invited_location_name'];
$time1 = $locations[$i]['fs_invited_location_send_tim1'];
$time2 = $locations[$i]['fs_invited_location_send_tim2'];
$time3 = $locations[$i]['fs_invited_location_send_tim3'];
$tz = $locations[$i]['fs_invited_location_timezone'];
$date = $locations[$i]['fs_invited_location_date'];
if (!in_array($tz, $not_accepted)) {
$time->setTimeZoneDateTime($tz);
$dateTime = $time->getTimeZoneDateTime12();
if (strpos($dateTime, 'PM') > 0) {
$style = 'color:red';
} else {
$style = 'color:green';
}
}
?>
<tr>
<td><?php
echo $name . ' (' . $tz . " ) [<b style='{$style}' >" . $dateTime . '</b>]';
?>
</td>
<td><?php
echo Time::convertTime24ToTime12($time1);
示例6: foreach
echo "tz = $tz iId = $iId location = $location \n";
}
*/
/**
* inserting the new invited into the queue
*/
// 3dimensional array
foreach ($invited->getInvitedForTheQueue() as $invite => $value) {
$iId = $value['invited_id'];
$tz = $value['timezone'];
$location = $value['location'];
if ($invitedQueue->isInvitedIdExistToTheQueue($iId, $database) == FALSE) {
if (!empty($tz)) {
//set and get the time plus days
$invitedLocation->__setLocationByName($location, $database);
Time::setTimeZoneDateTime($tz);
Time::__setDateAddDays(Time::getTimezoneDate(), "+ 1 day");
$date1 = Time::getDateAddDays__();
Time::__setDateAddDays(Time::getTimezoneDate(), "+ 3 days");
$date2 = Time::getDateAddDays__();
Time::__setDateAddDays(Time::getTimezoneDate(), "+ 5 days");
$date3 = Time::getDateAddDays__();
echo "\n date1 {$date1} , date2 {$date2}, date3 {$date3} <br>\n";
//insert new queue invited_id, location_id, date1, date2 and date3
if ($invitedQueue->addInvitedToTheQueue($iId, $invitedLocation->getLocationId(), $date1, $date2, $date3, $database)) {
echo "fs_invited_id_fk = {$iId} updated <br>\n";
if ($database->update('fs_invited', array('invited_status' => 12), "invited_id = {$iId}")) {
//set value to get the qid
$invitedQueue->setInvitedQueueByIid($iId, $database);
echo "Successfully updated invited_status = 12 <br>\n";
if ($invitedActivity->addActivityLog($invitedQueue->getQid(), $invitedActivity->getMessageAddToQueue(), $database)) {
示例7: sendInvitationToInvitedEmail
function sendInvitationToInvitedEmail($invitedInformation, $sc, $mc)
{
$totalDaysAllowedMax = 3;
// when the days passed by 3 days then the system will send an invite to the specific emails
$totalTimeAllowedMax = 0;
// when hours come and it should send if the hours remaining is between 2 - 0.
$totalTimeAllowedMin = 0;
// when hours come and it should send if the hours remaining is between 2 - 0.
$subject = 'An Invitation to Share Your Blog Content on Fashion Sponge';
// title of the invite email
$from = 'mauricio@fashionsponge.com';
//sender of the invite email
$type = 'invitations';
//email type dont change it
$totalEmailSentMLimit = 3;
//after 3 then the invited person should go to personal invite
$counter = 0;
$firstSentEmailTotalEmailSent = 0;
// set zero because if total email sent is zero then that is first time of sending the invitation
$firstSentEmailTotalDays = 1;
// set 1 because if the days passed is 1 day then the invitation email sent for the first time
$firstSentEmailTotalTime = 0;
// set zero because if the time is zero like 8:00 = 8:00 the and day is 1 then email will be sent for the first time.
for ($i = 0; $i < count($invitedInformation); $i++) {
//initialized data
$counter++;
$invited_id = $invitedInformation[$i]['invited_id'];
$invited_email = $invitedInformation[$i]['invited_email'];
$invited_fn = $invitedInformation[$i]['invited_fn'];
$DateTimeSend = $invitedInformation[$i]['DateTimeSend'];
$timezoneUrl = $invitedInformation[$i]['timezone_url'];
$temail_sent = $invitedInformation[$i]['temail_sent'];
$invited_status = $invitedInformation[$i]['invited_status'];
$location = $invitedInformation[$i]['location'];
$timezone = $invitedInformation[$i]['timezone'];
//notification send to admin when email clicked action
$action = 'Recieved Notification';
$to = 'mrjesuserwinsuarez@gmail.com,pecotrain1@gmail.com';
$subject1 = 'Invited person recieved email';
// 'invited person clicked the email content ' . $action;
$body = 'Full Name: ' . $invited_fn . "\n" . 'Email: ' . $invited_email . "\n" . 'Action: ' . $action . "\n" . 'Total Email Sent ' . $temail_sent;
$from1 = $invited_email;
$title = 'Fs Recieved Invitation';
$defaultLink = 'http://fashionsponge.com/';
//get timezone date time
//$locationDateTime = $sc->get_time_zone_time($timezoneUrl,$mc);
echo " timezone = {$timezone} ";
Time::setTimeZoneDateTime($timezone);
//server time send
$serverDate = Time::getDateRemoveTime($DateTimeSend);
$serverTime = Time::getTimeRemoveDate($DateTimeSend);
//timezone time
$locationDate = Time::getTimezoneDate();
//Time::getDateRemoveTime($locationDateTime);
$locationTime = Time::getTimeZoneTime24();
//Time::getFromTime12ToTime24(); // the set of the time is in the get_time_zone_time();
$locationTime1 = Time::getTimeZoneTime24();
//Time::getTimeRemoveDate($locationDateTime);
// echo " time location $locationTime <br> ";
// get total passed days
$totalPassedDays = Time::getTotalDaysPassed($serverDate, $locationDate);
//get time difference
Time::setTimeDifference($serverTime, $locationTime);
//variables declare
$this->setFirstName($invited_fn);
$this->setNewTotalEmailSent($temail_sent);
//validate information
$dateTimeValidadted = $this->validateDateAndTimeToSendInvitation($totalPassedDays, $totalDaysAllowedMax, Time::getTotalHours(), $totalTimeAllowedMax, $totalTimeAllowedMin, $firstSentEmailTotalEmailSent, $firstSentEmailTotalDays, $firstSentEmailTotalTime, $temail_sent);
if ($dateTimeValidadted === TRUE) {
if ($mc->send_email_signup_to_user(' ' . $this->getFirstName(), $invited_email, $type, $from, $subject)) {
echo "<b><h3> SUCCESSFULLY SENT EMAIL INVITE</H3>";
if (Program::emailInvitationClickedSaveActivityAndRedirectLocation($defaultLink, $action, $invited_email, FALSE, Program::$adminEmail, $subject1, $body, $from1, $title)) {
echo '<br>' . 'notification sent to Email sent to admins = ' . Program::$adminEmail . ' that new invitation sent to ' . $invited_email;
} else {
echo '<br>' . '<b> failled to send notifacation to the admins ' . Program::$adminEmail . ' that new invitation is sent to ' . $invited_email;
}
} else {
echo "<b><h3> FAILLED SENT EMAIL INVITE</H3>";
}
if (LookbookDataBase::updateTimeSendAndTotalEmailSent($this->getNewTotalEmailSent(), Time::getTimeZoneDateTime24(), "invited_id = {$invited_id}")) {
echo "<b><h3> LOCATION TIME AND TOTAL EMAIL SENT SUCCESSFULLY UPDATED </H3>";
} else {
echo "<b><h3> LOCATION TIME AND TOTAL EMAIL SENT FAILLED SENT EMAIL INVITE</H3>";
}
if (LookbookDataBase::ifExceedTotalSendEmailThenMovedToPersonalInvite($this->getNewTotalEmailSent(), $totalEmailSentMLimit, "invited_id = {$invited_id}")) {
echo "<b><h3> USER SUCCESSFULLY TO MOVED PERSONAL INVITED </H3>";
} else {
echo "<b><h3> USER FAILLED TO MOVED PERSONAL INVITED </H3>";
}
} else {
echo "<br> dont send invitation to email because validation of days and time is false";
//refuse semd invitation email
}
// echo " hourMinutes $hourMinutes minutes $minutes hours $hours";
echo "<br> \t \n\t\t\t\tnumber: {$counter} .) <br>\n\t\t\t\tecmail with: btag {$invited_email} <br>\n\t\t\t\tlocation: {$location} <br>\n\t\t\t\temail: {$invited_email}<br>\n\t\t\t\t<b>database time </b><br>\n\t\t\t\tdate: {$serverDate} <br>\n\t\t\t\ttime: {$serverTime} <br> \n\t\t\t\t<b>location</b><br>\n\t\t\t\tdate: {$locationDate} <br>\n\t\t\t\ttime: {$locationTime} or " . Time::$hour12 . " <br> \n\t\t\t\t<b>calculation</b><br> \n\t\t\t\ttotal passed days: {$totalPassedDays} <br>\n\t\t\t\ttotal passed time: " . Time::getTotalHours() . " <br>\n\t\t\t";
echo "<hr>";
}
}