日期检查/比较 [英] A date Check/Comparison

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

问题描述

我有一个代码可以使用代码自动提前1天,但它不能按照我想要的方式100%工作。

I have a code that automatically advances the date 1 day using code, but its not working 100% the way I want it to.

展开 | 选择 | Wrap | 行号

推荐答案

我有点困惑。首先,如果是在上一天的午夜之前的任何事情,你说你想提前约会。然后您的示例描述了CURRENT日。请澄清,因为这将改变计算。
I''m a little confused. First you say you want to advance the date if it is anything before midnight of the PREVIOUS day. Then your example describes the CURRENT day. Please clarify as that will change the calculation.


是的,我的示例代码是正确的,因为我不知道该放什么而不是(现在)。我的第3班开始于晚上10:30,所以当他们开始输入数据时,日期将是例如8/3/2018,但他们的班次日期应该是8/04/2018。因此,当选择或在班次框中输入3时,我需要它提前一天。目前无论你什么时候输入3进入班次,它都会前进。这是我需要停止的行为。希望能够解决问题。
Yes my sample code is in correct, as I''m not sure what to put instead of (Now). My 3rd shift starts at 10:30pm, so when they start to enter data the date will be for example 8/3/2018, but the date of their shift should be 8/04/2018. So when the select or enter a 3 in the shift box I need it to advance one day. Currently no matter what time you input the 3 into shift it advances. This is the behavior I need to stop. Hope that cleared things up.


DJ,


第3班员工 总是 在午夜之前输入数据?如果是这样,那么我认为您的解决方案就像这样简单:

DJ,

Will the 3rd Shift employees ALWAYS be entering data prior to Midnight? If so, then I think your solution is as simple as this:

展开 | 选择 | Wrap | 行号


这篇关于日期检查/比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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