The time function gives you the current time in seconds. The previous day is the day which is at least 22 hours before the current time but has a different day date than the current day. 22 hours translates to 22 * 3600 seconds.
So one approach would be not to use localtime without an argument but localtime with a time() value adjusted for the difference you want and then check that the day date is different.
In reply to Re: Get previous date
by Corion
in thread Get previous date
by Chon-Ji
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |