douchao1957 2017-03-09 14:12
浏览 243

如何使timestamp值为timestamp + 8小时

Hi there I have a device that sends values from my sensors to table called 'sensors'... in my table I have a column called 'event' which is TIMESTAMP, date and time from my server which is -8 hours of my local time... because my device can't send time and date to my table, I try to call my server admin to change the timezone of the server but no luck from there, so now I need somehow when ever the device sends data to table in 'mytime' column to put 'event'TIMESTAMP+8hours how do I do that? here is my code

<?php
// Connect to MySQL

include("dbconnect1.php");

// Prepare the SQL statement

mysqli_query($dbcon,"SELECT * FROM sensors");
mysqli_query($dbcon,"INSERT INTO sensors (sensor1 ,sensor2, sensor3, sensor4, sensor5, sensor6 ,sensor7, sensor8, sensor9, sensor10, sensor11, sensor12) 
VALUES ('".$_GET["s1"]."', '".$_GET["s2"]."','".$_GET["s3"]."','".$_GET["s4"]."','".$_GET["s5"]."','".$_GET["s6"]."','".$_GET["s7"]."','".$_GET["s8"]."','".$_GET["s9"]."','".$_GET["s10"]."','".$_GET["s11"]."','".$_GET["s12"]."')");



mysqli_close($dbcon);

?>

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 BP神经网络控制倒立摆
    • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
    • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
    • ¥30 Unity接入微信SDK 无法开启摄像头
    • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
    • ¥20 cad图纸,chx-3六轴码垛机器人
    • ¥15 移动摄像头专网需要解vlan
    • ¥20 access多表提取相同字段数据并合并
    • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
    • ¥20 Java-Oj-桌布的计算