Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: I need help with MYSQL and timestamps
1 point by booruguru on March 15, 2013 | hide | past | favorite | 1 comment
I'm using an RSS parser called SimplePie for an RSS reader I built. Unfortunately, SimplePie does not insert a value into the db for items without a timestamp which is making things very wonky for users with certain feeds.

I need to add a default value (the time of insertion) to items without a timestamp. I'm new to PHP, but an RSS app I built on SimplePie has been getting a lot of users since the Google Reader shutdown and I need to fix this, ASAP.

A recent timestamp looks like this... "1326009170"

Using MYSQL/PHPadmin, can I set a default timestamp for this field that matches the format above?



http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.ht...

"The exception is that you can specify CURRENT_TIMESTAMP as the default for a TIMESTAMP column. See Section 11.1.5.5, “Automatic Initialization and Updating for TIMESTAMP”.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: