当前日期和昨天的日期问题 [英] Current Date and yesterdays date problem

查看:91
本文介绍了当前日期和昨天的日期问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面上有2个按钮,根据印度时间的不同,我的进出时间是下午6点,但下一天凌晨3点结束.

我必须更新时间,其中用户名和日期与输入"按钮上的相同.单击.但是在凌晨3点,更改和数据不匹配,我该如何解决这个问题.

请帮助,迫切需要解决方案.

I have 2 buttons On my page IN and Out according to indian time my shift is at 6pm but it overs at next date 3am.

I have to update out time where username and date are same as on IN button Click. But at 3am date gets change and data does not match,how could I solve this problem.

Please help,solution urgently required.

推荐答案

我认为他要制作的是一个日志系统,用户可以在该日志系统中登录并在其中插入一行一个日志表.该用户还应该注销并更新他刚刚注销的行,并设置注销时间.时间之间的时差将稍后用于计算用户的工作时间等.

这是一个解决方案.
首先,在您像"R"这样的登录名后,在您的行上放置一个STATUS,表示正在运行.其次,当用户再次意外登录时,应该通知他已经登录,并且如果已经过了24个小时,则他忘记了注销,并且上一行将从数据库中删除或取消.在这种情况下,您可以将状态更改为"C",也可以将其彻底删除(如果您是邪恶的).第三,当用户注销搜索时,如果他的运行时间在当天的同一天之内.如果是这样,请获取该行并进行更新以放置注销时间,并将STATUS更改为"F"-已完成.否则,告诉他他当天没有登录,因此注销没有任何意义.

仅获得一个时钟,以便日期检索没有问题.不要根据日期和ID更新,请根据ID和STATUS更新.

希望对您有帮助
I think what he is trying to make is a logging system where a user would log-in and insert such as a row to a log-table. Such user should also log-out and update the row he just logged out and place a log-out time. The difference between the time will later be used to calculate the user''s work time, etc.

Here is a solution.
First, place a STATUS on your row after you log-in like ''R'' to mean RUNNING. Second, when the user log-in again accidentally, he should be informed that he has already logged and if 24 hours has elapsed -- that he forgot to log-out and the previous row will be deleted or cancelled from the database. In this case, you could change the STATUS to ''C'' or delete it outright (if you''re evil). Third, when the user logs out search if he has a running time that is within the same day as the current day. If so, get the row and update it to place the log-out time as well as changing the STATUS to ''F'' - Finished. Otherwise, tell him that he did not log-in for the day, so there''s no point in logging out.

Get only one clock so that there is no problem with the date retrieval. Do not update based on date and id, update it based on id and STATUS.

I hope this helps


我无法理解您的问题,请在此处发布您的代码或清楚地询问您的问题?
i cant understand ur question , pls post ur code here or ask ur question clearly?


这篇关于当前日期和昨天的日期问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆