The timestamp you're generating with gmdate() isn't a timestamp, it's a formatted datetime string. A timestamp is an integer expressing the number of seconds since January 1st, 1970 GMT. You can generate one with strtotime('now') , assuming the timezone of your server is set correctly.