@deepprod

Не корректно записывается дата как исправить?

Здравствуйте, почему вместо сегодняшней даты записывает: 01/01/1970

Вот код php:
public function edit_history_suc_pro($id) // Форма изменения статуса - Успех
	{
		if(!$this->user->info->admin && !$this->user->info->admin_members) {
			$this->template->error(lang("error_2"));
		}
		$id = intval($id);
		$history = $this->admin_model->edit_history($id);
		if ($history->num_rows() ==0 ) $this->template->error(lang("error_13"));

		$label = $this->common->nohtml($this->input->post("label"));
		$status = $this->common->nohtml($this->input->post("status"));
		$email = $this->common->nohtml($this->input->post("email"));
		$transaction = $this->common->nohtml($this->input->post("transaction"));
		$timestamp = $this->common->nohtml($this->input->post("timestamp"));
		$pay_method = $this->common->nohtml($this->input->post("pay_method"));
		$amount = $this->common->nohtml($this->input->post("amount"));
		$name = $this->common->nohtml($this->input->post("name"));
		$comment = $this->common->nohtml($this->input->post("comment"));

		$this->admin_model->update_history($id, 
			array(
			"label" => $label,
			"status" => $status,
			"transaction" => $transaction,
			"timestamp" => $timestamp,
			"pay_method" => $pay_method,
			"amount" => $amount,
			"name" => $name,
			"comment" => $comment,
			"email" => $email
				)
		);

		
		$api_key=$this->settings->info->mailgun_api;/* Api Key got from https://mailgun.com/cp/my_account */ 
		$domain =$this->settings->info->mailgun_domain;/* Domain Name you given to Mailgun */ 
		$ch = curl_init(); 
		curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); 
		curl_setopt($ch, CURLOPT_USERPWD, 'api:'.$api_key); 
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
		curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); 
		curl_setopt($ch, CURLOPT_URL, 'https://api.mailgun.net/v2/'.$domain.'/messages'); 
		curl_setopt($ch, CURLOPT_POSTFIELDS, array( 'from' => ''.$this->settings->info->site_name.' <'.$this->settings->info->site_email.'>',
		'to' => $email,
		'subject' => "Платеж получен!",
		'html' => '<html>Здравствуйте, уважаемый клиент! <br><br>От Вас успешно получен платеж по счету '.$transaction.' в сумме <b>'.$amount.' '.$this->settings->info->currency.'</b> <br><br><b>Детали операции:</b><br>Дата платежа: '.$timestamp.'<br>Назначение платежа: '.$name.'<br>Способ оплаты: '.$pay_method.'<br>Комментарий к оплате: '.$comment.'.<br><br><b>'.$this->settings->info->site_name.'<br>'.$this->settings->info->site_email.'</b></html>'
		));
		$result = curl_exec($ch);
		curl_close($ch);
		
		$this->session->set_flashdata("globalmsg", "Статус успешно изменен. Пользователь будет уведомлен о смене статуса, если у Вас настроен MailGun API");
		redirect(site_url("admin/history"));
	}


Вот код записи из формы:

<input type="hidden" name="timestamp" value="<?php echo date($this->settings->info->date_format, $r->timestamp) ?>">


Формат даты:
d.m.y H:i:s
  • Вопрос задан
  • 82 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы