php - How to correct my gmdate method? -


my code working thing $todaystamp shows 3 hours before clock time. , wanna fix it. (gmt+3) still want use gmdate method because don't know how change rest of... how can without broke other codes? thanks...

  <?php       function sendicalemail($firstname,$lastname,$email,$meeting_date,$meeting_name,$meeting_duration,$message1,$place1) {          $from_name = "furkan Öksüz";         $from_address = "furk.oksuz4@gmail.com";         $subject = "olusturulan etkinlik"; //doubles email subject , meeting subject in calendar         $meeting_description = $message1;         $meeting_location = $place1; //where meeting take place          //convert mysql datetime , construct ical start, end , issue dates         $meetingstamp = strtotime($meeting_date . " utc");          $dtstart= gmdate("ymd\this\z",$meetingstamp);         $dtend= gmdate("ymd\this\z",$meetingstamp+$meeting_duration);         $todaystamp = gmdate("ymd\this\z",strtotime("+3 hours"));              $cal_uid = date('ymd').'t'.date('his')."-".rand()."@mydomain.com";          //create mime boundry         $mime_boundary = "----meeting booking----".md5(time());          //create email headers         $headers = "from: ".$from_name." <".$from_address.">\n";         $headers .= "reply-to: ".$from_name." <".$from_address.">\n";          $headers .= "mime-version: 1.0\n";         $headers .= "content-type: multipart/alternative; boundary=\"$mime_boundary\"\n";         $headers .= "content-class: urn:content-classes:calendarmessage\n";          //create email body (html)         $message .= "--$mime_boundary\n";         $message .= "content-type: text/html; charset=utf-8\n";         $message .= "content-transfer-encoding: 8bit\n\n";          $message .= "<html>\n";         $message .= "<body>\n";         $message .= '<p>merhaba '.$firstname.' '.$lastname.',</p>';         $message .= $message1;             $message .= "</body>\n";         $message .= "</html>\n";         $message .= "--$mime_boundary\n";          $ical =    'begin:vcalendar     prodid:-//microsoft corporation//outlook 11.0 mimedir//en     version:2.0     method:publish     begin:vevent     organizer:mailto:'.$from_address.'     dtstart:'.$dtstart.'     dtend:'.$dtend.'     location:'.$meeting_location.'     transp:opaque     sequence:0     uid:'.$cal_uid.'     dtstamp:'.$todaystamp.'     description:'.$meeting_description.'     summary:'.$subject.'     priority:5     class:public     end:vevent     end:vcalendar';             $message .= 'content-type: text/calendar;name="meeting.ics";method=request;charset=utf-8\n';         $message .= 'content-type: text/calendar;name="meeting.ics";method=request\n';         $message .= "content-transfer-encoding: 8bit\n\n";         $message .= $ical;                      //send mail         $mail_sent = @mail( $email, $subject, $message, $headers );          if($mail_sent)     {             return true;         } else {             return false;         }         }       ?> 


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -