开发者

PHP - Unix timestamp [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_Python百科 Closed 10 years ago.

I have this:

$time = time();
SELECT * FROM users WHERE lastlogin>'$time-86000'

How do I select from the database, where the lastlogin has been completed within the last 24 hours?

I also have this:

SELECT * FROM users WHERE signupdate>'$time-86000'

What I wish to archive here is, how do I select from the database, where the last signupdate is within 24 hours


Mysql can handle unix timestamps as well

select * from table where stamp > unix_timestamp() - 24*3600


SELECT DATEDIFF(signupdate,.'date('h-i-s).') FROM users;

Then if it is above 1 its more than 24hours, else its not.

Ill try to see if i can get into a where clause...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜