willpower Posted July 24, 2008 Share Posted July 24, 2008 Ok so i have a db driven date yyyy-mm-dd lets say this is $date. what is the most code effiecient way to add 1 year to that date ideally without exploding the date components? Thanks as ever Will Link to comment https://forums.phpfreaks.com/topic/116491-solved-date-dont-fricking-laugh/ Share on other sites More sharing options...
akitchin Posted July 24, 2008 Share Posted July 24, 2008 you can do this directly through the database, assuming it is formatted as a DATE type: SELECT DATE_ADD(date_column, INTERVAL 1 YEAR) AS new_date FROM foo Link to comment https://forums.phpfreaks.com/topic/116491-solved-date-dont-fricking-laugh/#findComment-599024 Share on other sites More sharing options...
willpower Posted July 24, 2008 Author Share Posted July 24, 2008 ohhhh now theres a thing i never knew...tyvm Link to comment https://forums.phpfreaks.com/topic/116491-solved-date-dont-fricking-laugh/#findComment-599028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.