Jump to content

Unix Time Stamp


dmccabe

Recommended Posts

A couple of questions:

 

1) Is the unix timestamp the best to use when you may want to perform some calculations on a date/time field late on?

if so

2) How do I insert the time stamp in to my database? I know how to do the insert, but what function grabs the current time stamp?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/110630-unix-time-stamp/
Share on other sites

I am still on the fence and switch back and forth between using datatype of DATETIME and INT in mysql. INT is how you would store the unix timestamp. I prefer timestamps cus they are timezone free and easier to do calculations on in PHP. But, with a DATETIME datatype you can do more calculations in the mysql query. And you can always convert it to a timestamp with the mysql function UNIX_TIMESTAMP(date)

 

....so choice is yours

Link to comment
https://forums.phpfreaks.com/topic/110630-unix-time-stamp/#findComment-567563
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.