Date Manipulation Class |
[eluser]Vicente Russo[/eluser]
Just made a small library that helped me a lot. Maybe it can be useful for someone. This library can add or subtract days, months or years and return the result in mysql-ready format or timestamp. Check it out!
[eluser]sophistry[/eluser]
thanks for sharing... it's great to see such a nicely formatted and documented contribution. but, (not to pop your bubble too hard) you need to look at this thread: http://ellislab.com/forums/viewthread/120895/ basically, get to know the strtotime() function and you won't need this lib. it's much easier to let the PHP guys maintain code than to do it yourself! cheers.
[eluser]xwero[/eluser]
in php5.3 you can add or substract dates using the date_add and date_sub methods in procedural or OO style. Code: $date = new DateTime(); // same as time function Code: $date = new DateTime(); // same as time function |
Welcome Guest, Not a member yet? Register Sign In |