Getdate()超越? [英] Getdate() over-ride?

查看:95
本文介绍了Getdate()超越?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力制作一系列工作日但是想要周六和周日强制

返回上周五的日期,例如

周日9 / 12/04应该在星期五9/10/04返回,同样周六

9/11/04应该在9/10/04周五返回。


我我们分别尝试了getdate() - 1和getdate() - 2但是得到了

堆栈溢出错误。我做错了什么,或者这只是不是可能吗?

I''m trying to produce an array of working days but want to force
Saturday and Sunday to return the date of the previous Friday, e.g.
Sunday 9/12/04 should return Friday 9/10/04 and similarly Saturday
9/11/04 should return Friday 9/10/04.

I''ve tried getdate()-1 and getdate()-2 respectively but am getting
stack overflow errors. Am I doing anything wrong, or is this just not
possible?

推荐答案

On Sun,12 2004年9月21:29:15 GMT,比尔爱德华兹< bi ********** @ ntlworld.com>

写道:
On Sun, 12 Sep 2004 21:29:15 GMT, Bill Edwards <bi**********@ntlworld.com>
wrote:
我正在努力制作一系列的工作日但是想强迫周六和周日返回上周五的日期,例如
周日9/12/04应该会在9月9日周五返回/ 04和类似的星期六
9/11/04应该在9/10/04周五返回。

我已经尝试了getdate() - 1和getdate() - 2分别是得到堆栈
溢出错误。我做错了什么,或者这是不可能的?
I''m trying to produce an array of working days but want to force
Saturday and Sunday to return the date of the previous Friday, e.g.
Sunday 9/12/04 should return Friday 9/10/04 and similarly Saturday
9/11/04 should return Friday 9/10/04.

I''ve tried getdate()-1 and getdate()-2 respectively but am getting stack
overflow errors. Am I doing anything wrong, or is this just not possible?




是的,这是可能的,但我们怎么能说出你做错了什么?你

没有显示任何代码。


Mike


-

Michael Winter

替换.invalid与.uk通过电子邮件回复。



Yes, it''s possible, but how can we tell what you''ve done wrong? You
haven''t shown any code.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


Bill Edwards于2004年12月12日在comp.lang.javascript写了
Bill Edwards wrote on 12 sep 2004 in comp.lang.javascript:
我正在努力制作一系列工作日但是想强迫周六和周日返回上周五的日期,例如
周日9/12/04应该返回星期五9/10/04和类似星期六
9/11/04应该在星期五9/10/04返回。

我试过getdate() - 1和getdate() - 分别是2但是得到堆栈溢出错误。我做错了什么,或者这只是不可能?
I''m trying to produce an array of working days but want to force
Saturday and Sunday to return the date of the previous Friday, e.g.
Sunday 9/12/04 should return Friday 9/10/04 and similarly Saturday
9/11/04 should return Friday 9/10/04.

I''ve tried getdate()-1 and getdate()-2 respectively but am getting
stack overflow errors. Am I doing anything wrong, or is this just not
possible?




一切皆有可能。请显示您的代码。


如果不是(工作日定义为mon..fri)请显示您的定义。

-

Evertjan。

荷兰。

(请将x''es更改为我的电子邮件地址中的点数,

但是让我们继续讨论新闻组。



anything is possible. Please show your code.

If not ("working days" is defined as mon..fri) please show your definition.
--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)


Bill Edwards说:
Bill Edwards said:

我正在努力产生一系列工作日,但希望强制周六和周日返回上周五的日期,例如
周日9/12/04应该在周五9/10/04返回,同样周六
9/11/04应该在9/10/04周五返回。

我已经尝试了getdate() - 1和getdate() - 2分别得到了
堆栈溢出错误。我做错了什么,或者这只是不可能?

I''m trying to produce an array of working days but want to force
Saturday and Sunday to return the date of the previous Friday, e.g.
Sunday 9/12/04 should return Friday 9/10/04 and similarly Saturday
9/11/04 should return Friday 9/10/04.

I''ve tried getdate()-1 and getdate()-2 respectively but am getting
stack overflow errors. Am I doing anything wrong, or is this just not
possible?




是的,你做错了什么,但我认为没有我们

可以准确猜出该描述的内容。发布网址

的网页或s * brief *示例来说明问题。


没有getdate()我知道的方法,所以我假设你

的确意味着getDate()。

从中扣除后,你在做什么?

您的代码将在2005年1月1日星期六做什么?



Yes, you are doing something wrong, but I don''t think any of us
can guess exactly what it is from that description. Post the URL
of a web page or s *brief* example that demonstrates the problem.

There is no "getdate()" method that I know of, so I assume you
really mean "getDate()".
What are you doing with the value after you subtract from it?
What will your code do on Saturday, January 1, 2005?


这篇关于Getdate()超越?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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