English 中文(简体)
网址日期功能正在恢复错失年份
原标题:php date function is returning wrong year
  • 时间:2012-01-12 17:29:20
  •  标签:
  • php
  • date

对于我来说,我可以这样说。 我有一天需要格式。 该页上有多个日期,格式只是罚款。

echo date( M jS o ,strtotime( 2012-12-31 )) //is returning "Dec 31st 2013". 
echo date( M jS o ,strtotime( 2013-12-31 )) //is returning "Dec 31st 2014".

因此,今年将持续一年。

......

date( M jS o ,strtotime( 2011-12-31 )) //returns correctly "Dec 31st 2011". 
date( M jS o ,strtotime( 2010-12-31 )) //returns correctly "Dec 31st 2010".

而后退却则罚款。 玛雅人是否向我们或某些人投了这套假肢?

任何想法? 我假定有一个简单的答案。

感谢!

问题回答

使用<代码>Y的年度,而不是o。 缩略语 说明:

<代码>o:ISO-8601年编号。 这与Y具有相同价值,但如果ISO周数(W)属于前一年或明年,则该年改为。 (PHP 5.1.0中的增加)





相关问题
Mysql compaire two dates from datetime?

I was try to measure what is faster and what should be the best way to compare two dates, from datetime record in MySql db. There are several approaches how to grab a date from date time, but I was ...

iPhone Date Picker rolls over to 2010 on December 27th?

So I implemented a UIDatepicker in one of my applications for scheduling and autodialing teleconferences... everything is pretty much ready to go except, while testing I noticed that when the date ...

Convert date Python

I have MMDDYY dates, i.e. today is 111609 How do I convert this to 11/16/2009, in Python?

specifying date format when using $form->inputs() in CakePHP

I am wondering if there is a way to specify the date format in the forms created using CakePHP s $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() ...

NSDateFormat, super simple! Where am I screwing up?

Ok, this is really simple, maybe I m a getting a bit burnt out, but seems like it should work, Query XML feed, put out date string, format, display in a cell. The issue is I m a getting a NULL ...

sqlite writing a date into an email

I am exporting a date value from sqlite and placing it into an email. The date appears like this 279498721.322872 I am using Objective C in an Iphone App. Does anyone know how to make this export ...

热门标签