问题描述
我必须每周更新一页。我提前得到了这个页面所以我使用了
预定包括 Frontpage中的webbot只是为了找到我每周刷新页面以使其工作的
。这很愚蠢,它应该单独运行
。所以......
我在FP小组中提出了这个问题,并且我被提供了这个伪代码
按月完成,如果有可能的话它一周没有
写了52个单独的行,每周一个,每年都会改变
,每年都要重写。
<%If Now()> date(" 1/3/2005")然后%>
<! - #include file =" includes / mar的.asp" - >
<%elseif Now()> date(" 1/2/2005")然后%>
<! - # include file =" includes / feb.asp" - >
<%else%>
<! - #include file =" includes / jan.asp" - >
<%endif%>
现在我的目标是计算
$的哪一周b $ b年份(任何一年)。
即1月1日7日= w1.htm,1月8日至15日= w2.htm等,并为每个人返回一个Wx.htm />
周。
这样我所要做的就是保存一个wx.htm文件,其中x =一年中的一周。
所以...如何我可以知道一年中的哪一周吗?
I have to update a page every week. I get the page ahead of time so I used
the "scheduled includes" webbot in Frontpage only to find that I would have
to refresh the page every week to have it work. That is silly, it should run
by itself. so...
I asked the question in the FP group and I was offered this pseudocode
to do it by month which would work if it''s possible to do it by week without
writing 52 seperate lines, one for each week which would change each year
and have to be rewritten each year.
<% If Now()>date("1/3/2005") then %>
<!-- #include file="includes/mar.asp" -->
<% elseif Now()>date("1/2/2005") then %>
<!-- #include file="includes/feb.asp" -->
<% else %>
<!-- #include file="includes/jan.asp" -->
<% endif %>
Now the goal for me would be something that would calculate which week of
the year (any year) it is.
i.e. Jan 1-7 = w1.htm , Jan 8-15= w2.htm etc. and return a Wx.htm for each
week.
That way all I have to do is save a wx.htm file where x= week of year.
so ... how can I caclulate what week of the year it is?
推荐答案
使用DatePart函数。这是在线文档:
将1月1日 - 7日总是第1周?
第53周会不会只包含一两天?
Will January 1 - 7 always be Week 1?
Will Week 53 always consist of just one or two days?
这篇关于包括基于一周中的一周的页面。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!