因此,我在我正在使用的日历脚本之外创建了一个表单。
我提交了一个日期从Java日期拾取器工作很好。唯一的问题是,使用日期的脚本会根据需要减去4小时。
有没有办法增加4个小时的提交日期,以便它正确地显示在管理员时,他们去批准的事件,已提交。
示例:
我在上午10:00提交表格,管理员会在早上6点提交表格
脚本管理员中的代码补偿了UTC。
<?php
if (!isset($_POST['submit'])) {
?>
<?php
} else {
$input_arr = array();
foreach ($_POST as $key => $input_arr) {
$_POST[$key] = addslashes($input_arr);
}
$user_id = $_POST['user_id'];
$listing_id = $_POST['listing_id'];
$status = $_POST['status'];
$title = $_POST['title'];
$description_short = $_POST['description_short'];
$description = $_POST['description'];
$venue = $_POST['venue'];
$location = $_POST['location'];
$admission = $_POST['admission'];
$contact_name = $_POST['contact_name'];
$website = $_POST['website'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$date = $_POST['date'];
$date_start = $_POST['date_start'];
$date_end = $_POST['date_end'];
mysql_query("INSERT INTO `pmd_events` (user_id, listing_id, status, title, description_short, description, venue, location, admission, contact_name, website, email, phone, date, date_start, date_end) VALUES ('$user_id', '$listing_id', '$status', '$title', '$description_short', '$description', '$venue', '$location', '$admission', '$contact_name', '$website', '$email', '$phone', '$date', '$date_start', '$date_end')");
$id = mysql_insert_id();
mysql_query("INSERT INTO `pmd_events_dates` (event_id,date_start,date_end,rsvp_reminder_sent) VALUES ($id,'$date_start', '$date_end',0)");
echo "verbage";
}
?>发布于 2015-07-22 05:37:31
提交的内容很可能包含时区。不同之处在于提交的内容与提交者的时区不同。
要么不发送时区,要么修剪该值以忽略时区。你甚至可以两者兼而有之
https://stackoverflow.com/questions/31547017
复制相似问题