Been trying my hand lately in programming in Perl. Doing some database things with it. It’s quite an interesting language. I’m rather enjoying it, if I’m being honest. Coming from a Java background, I find it exciting to learn new things and take them as they come to me. It’s fun for sure!
Talk about way easy to add to a date using MySQL. Didn't know it would be this simple:
Let's say you want to add a certain number of years to a date:
DATE_ADD(NOW(), INTERVAL 1 YEAR)
Now, wasn't that easy?
You can do the same thing for days as well. Just change INTERVAL 1 YEAR to INTERVAL 1 DAY
Yep, that's pretty much it.
Happy coding!
Comments
Post a Comment