Has strtotime functionality gone from api date object creation?

ekes - March 12, 2008 - 19:31
Project:Date
Version:5.x-2.x-dev
Component:Date API
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I like the new cleaner date_make_date() function.

Is there any functionality exposed in the API (or intended to be) to do string to time guessing for those occasions where it's not matching any of the available REGEX?

aside
As I type it occurs to me one of the occasions where I want to parse dates not matching a present regex is when they are in RFC822(2) date format which I believe match these (according to the python source of the feedvalidator.org):

  rfc822_re = re.compile("(((mon)|(tue)|(wed)|(thu)|(fri)|(sat)|(sun))\s*,\s*)?" +
    "\d\d?\s+((jan)|(feb)|(mar)|(apr)|(may)|(jun)|(jul)|(aug)|(sep)|(oct)|" +
    "(nov)|(dec))\s+\d\d(\d\d)?\s+\d\d:\d\d(:\d\d)?\s+(([+-]\d\d\d\d)|" +
    "(ut)|(gmt)|(est)|(edt)|(cst)|(cdt)|(mst)|(mdt)|(pst)|(pdt)|[a-ik-z])?$",
    re.UNICODE)
  rfc2822_re = re.compile("(((Mon)|(Tue)|(Wed)|(Thu)|(Fri)|(Sat)|(Sun)), )?" +
    "\d\d? ((Jan)|(Feb)|(Mar)|(Apr)|(May)|(Jun)|(Jul)|(Aug)|(Sep)|(Oct)|" +
    "(Nov)|(Dec)) \d\d\d\d \d\d:\d\d(:\d\d)? (([+-]?\d\d[03]0)|" +
    "(UT)|(GMT)|(EST)|(EDT)|(CST)|(CDT)|(MST)|(MDT)|(PST)|(PDT)|Z)$")

#1

ekes - March 20, 2008 - 14:52
Status:active» closed

Answer is now there is now a php datetime object made using php5's http://php.net/date_create and php4 version of it with the module.

 
 

Drupal is a registered trademark of Dries Buytaert.