php获取去年十月的时间戳

Is it possible to get the last october using strtotime ?

eg strtotime("last October");

currently im using this but would prefer to use strtotime

date("Y-m-d", mktime(0,0,0,10,1,date("Y") - !(date(m) > 9)))

You can use something like this:

strtotime(date('Y-10-01') . (date('m') < 10 ? ' -1 year' : ''));

Not sure how you want to deal with the case that it is currently october. If you want it to show last october then change the < to a <=.

in strtotime function, for the time argument you need to consider the GNU syntax which are all applicable. not sure that you can directly use the string "last october" to get the timestamp value. for more info, refer http://www.gnu.org/software/tar/manual/html_chapter/Date-input-formats.html.