Results 1 to 3 of 3
Apr 8, 2013, 10:51 #1
- Join Date
- Nov 2003
- Columbus, OH
- 65 Post(s)
- 2 Thread(s)
Convert string to date by passing pattern?
Having trouble researching this one or coming up with my own solution. I need to be able to pass a date/time pattern that will then used to convert a string to DateTime.
$string = '20130408164312'; // yyyymmddhhmmss $string2 = '2013-04-08 16:43:12'
I should be able to pass both of those strings to a function, along with some sort of pattern string and be able to return a DateTime object. I'm trying to make this completely versatile. Ideas/functions you've already come across?Kyle Wolfe