年度最后一天Date Bug? [英] Last Day of Year Date Bug?
问题描述
伙计们,下面的一行刚刚返回07年12月。作为一个月的日期
从今天开始。几乎没有生命危险,但任何想法?
<?php打印日期(" M`y",mktime(0,0,0,日期(&m;)) -1,日期(d),
日期(Y)));?>
AS
ashore写道:
伙计们,下面的行刚刚返回12月07日作为一个月的日期
从今天开始。几乎没有生命危险,但任何想法?
<?php打印日期(" M`y",mktime(0,0,0,日期(&m;)) -1,日期(d),
日期(Y)));?>
AS
有趣。看起来这可能是一个错误。
-
==================
删除x来自我的电子邮件地址
Jerry Stuckle
JDS计算机培训公司
js ******* @ attglobal.net
==================
2007年12月31日星期一14:18:34 +0100,Jerry Stuckle
< js ******* @ attglobal。 netwrote:
ashore写道:
>伙计们,下面的行刚刚返回12月07日 ;作为一个月的日期
从今天开始。几乎没有生命危险,但是有什么想法吗?
<?php打印日期(" M`y",mktime(0,0,0,日期(&m;)) - 1,日期(" d") ;),
date(Y)));?>
AS
有趣。看起来它可能是一个bug。
不,
date(''m'') - 1 = 11
date(''d'')= 31
31-11-2007 = 01-12-2007就php而言。
不是一年结束的错误,而是每个月的第31个错误(嗯,功能我会
说,我知道会发生什么),并在3月份有一些奖励日期。
-
Rik Wasmus
Rik Wasmus写道:
周一,2007年12月31日14:18:34 +0100,Jerry Stuckle
< js ******* @ attglobal.netwrote:
> ashore写道:
>>伙计们,下面一行刚刚返回12月07日作为一个月的日期
从今天开始。几乎没有生命危险,但是有什么想法吗?
<?php打印日期(" M`y",mktime(0,0,0,日期(&m;)) - 1,日期(" d") ;),
date(Y)));?>
AS
有趣。看起来它可能是一个bug。
不,
date(''m'') - 1 = 11
date(''d'')= 31
31-11-2007 = 01-12-2007就php而言。
不是一年结束的错误,而是每个月的第31个错误(好吧,功能
我会说,我知道会发生什么),三月份有一些奖励日期。
啊,是的。现在我记得为什么我不这样做 - 它已经很久了
我忘了。
-
==================
删除x来自我的电子邮件地址
Jerry Stuckle
JDS计算机培训公司
js ******* @ attglobal.net
==================
Guys, the line below just returned "Dec 07" as the date for one month
back from today. Hardly life-threatening, but any thoughts?
<?php print date("M `y", mktime(0, 0, 0, date("m")-1, date("d"),
date("Y")));?>
AS
ashore wrote:Guys, the line below just returned "Dec 07" as the date for one month
back from today. Hardly life-threatening, but any thoughts?
<?php print date("M `y", mktime(0, 0, 0, date("m")-1, date("d"),
date("Y")));?>
AS
Interesting. Looks like it may be a bug.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
On Mon, 31 Dec 2007 14:18:34 +0100, Jerry Stuckle
<js*******@attglobal.netwrote:
ashore wrote:>Guys, the line below just returned "Dec 07" as the date for one month
back from today. Hardly life-threatening, but any thoughts?
<?php print date("M `y", mktime(0, 0, 0, date("m")-1, date("d"),
date("Y")));?>
AS
Interesting. Looks like it may be a bug.
Nope,
date(''m'')-1 = 11
date(''d'') = 31
31-11-2007 = 01-12-2007 as far as php is concerned.
Not ''end of a year'' bug, but ''31st of every month'' bug (well, feature I''d
say, I know what to expect), with a few bonus dates in march.
--
Rik Wasmus
Rik Wasmus wrote:On Mon, 31 Dec 2007 14:18:34 +0100, Jerry Stuckle
<js*******@attglobal.netwrote:
>ashore wrote:>>Guys, the line below just returned "Dec 07" as the date for one month
back from today. Hardly life-threatening, but any thoughts?
<?php print date("M `y", mktime(0, 0, 0, date("m")-1, date("d"),
date("Y")));?>
AS
Interesting. Looks like it may be a bug.
Nope,
date(''m'')-1 = 11
date(''d'') = 31
31-11-2007 = 01-12-2007 as far as php is concerned.
Not ''end of a year'' bug, but ''31st of every month'' bug (well, feature
I''d say, I know what to expect), with a few bonus dates in march.Ah, yes. Now I remember why I don''t do it this way - it''s been so long
I forgot.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
这篇关于年度最后一天Date Bug?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!