dateadd("d",10,currentTime)dateadd("w",10,currentTime)有什么区别? [英] What is the difference between dateadd("d", 10, currentTime) dateadd("w", 10, currentTime)

查看:97
本文介绍了dateadd("d",10,currentTime)dateadd("w",10,currentTime)有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

当我使用经典ASP时,我对此感到怀疑


有什么区别
dateadd("d",10,currentTime)
dateadd("w",10,currentTime)

两者都返回相同的输出.两者都会将当前日期时间增加10天.
在任何情况下,我们都能看到差异,因此我可以在需要的地方准确使用它们.我需要的是实际情况,而不是理论上的定义.如果可能,请给我发送邮件[地址已删除]

预先感谢您的想法.

Hi Everyone,

While i was working with classic ASP, I got a doubt that

What is the difference between

dateadd("d", 10, currentTime)
dateadd("w", 10, currentTime)

Both returns the same output. Both adds 10 days to the current datetime.
Is there any scenario where we can see the difference, so that i can use them exactly where they are required. I need the practical scenario not the theoretical definitions. If possible mail me [address removed]

Thanks in advance for your ideas.

推荐答案

此处的文档说明了不同之处:
此处

d-是每月的某天
w-是星期几

现在,出于您的目的/dateadd()函数-interval参数仅指示您要向初始日期添加的时间单位 [10天,月,年等]
因此对于此函数:d,w甚至y将相同,因为它们仅告诉函数加x天"

对于其他功能,两者之间是有区别的
The documentation here tells the difference:
HERE

d - is day of the month
w - is day of the week

Now for your purpose / dateadd () function - the interval parameter only indicates what unit of time you are adding to your initial date [10 days, months, years etc]
So for this function: d, w, and even y will be identical, because they are only telling the function "add x days"

For other functions there is a difference between the two


这篇关于dateadd("d",10,currentTime)dateadd("w",10,currentTime)有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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