Thanks fishmonger, I did look at a couple of those but I don't have the module loaded and I don't have the rights to install it. I did try working with epoch time and so far it works fine. The only problem I have is that I want to insert the output as a variable instead of using the printf.

It is worth drawing particular attention to the expected ranges for the values provided. The value for the day of the month is the actual day (ie 1..31), while the month is the number of months since January (0..11).