Saving timestamp in mysql table using php

前端 未结 15 831
既然无缘
既然无缘 2020-12-22 21:44

I have a field in a MySQL table which has a timestamp data type. I am saving data into that table. But when I pass the timestamp (1299762201428) to

15条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-22 22:23

    Use FROM_UNIXTIME().

    Note: 1299762201428 looks more like a millisecond-timestamp (like Date()*1 in JavaScript), and you probably have to divide that by 1000.

提交回复
热议问题