PHP 分页脚本中的日期和时间 - 小问题
我有一个用 PHP 编写的事件日历,其中包含从免费 PHP 站点获得的以下分页脚本。 这是基本脚本(标题为 PmcPagination.php):
http://pastebin.com/f7c5a4a90 (为了方便起见,链接到这里,太长了,无法完整发布!)
它的工作原理是显示所有事件 - 但日期与数据库不符,因此全部列出如下: 活动 1,1970 年 1 月 1 日 - 凌晨 1:00“家庭活动”设置提醒 事件 2,1970 年 1 月 1 日 - 凌晨 1:00“历史事件”设置提醒 ...接下来的 20、30、40 条记录依此类推。
我应该如何修复代码中的此日期/时间错误?它渲染正常......现在,但日期/时间问题很难修复。
在 Google 和各种 PHP 网站上进行的研究没有帮助,那么问题出在哪里呢? (该代码不是我自己的,而是别人的改编版本!)
I have an events calendar written in PHP, with the following pagination script that I obtained from a free PHP site.
This is the basic script (entitled PmcPagination.php):
http://pastebin.com/f7c5a4a90
(linked here for convenience, too lengthy to post in full!)
It works to the extent that it shows all events - but the dates do not tally with the database, and as such are all listed as the following:
Event 1 on January 1st, 1970 - 1:00am "Family Event" Set Reminder
Event 2 on January 1st, 1970 - 1:00am "Historical Event" Set Reminder
... and so on, for the next 20, 30, 40 records.
What should I do to fix this date/time error in the code? It's rendering OK ... for now but the date/time thing is proving tricky to fix.
Research on Google and various PHP sites did not help, so where has this gone wrong?
(The code isn't my own, but an adapted version of someone else's!)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1970 年 1 月 1 日日期上的任何内容都可能是日期 0。检查以确保该值不为 0 并且是有效整数。
Anything on a date of January 1st, 1970 is probably a date of 0. Check to make sure that the value is not 0 and is a valid integer.