PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Greetings phpiers. I'm kind of a newbie programmer and I need help creating a function that will take the current date and add a # of days to create an expiration date that can be stored in MySQL. Are there any pro up to the task?
The way these date calculations are usually done is to convert the date to a Unix timestamp. That is an integer that represents seconds since 1/1/1970. Once you have that then you can add 60*60*24 times the number of days to get to a date in the future. Finally, there are functions to convert back from a timestamp to a text date. Check the manual for the date/time functions. There are examples in the entry and user supplied examples.