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 Quote 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 Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.