02.07.2012, 05:28
Sir, there are some functions in the CTime library that will become useful to you. From formatting time strings (for example in format "2012-12-31" that you have mentioned) to getting timestamp diffs - this plugin has the functionality. And it is not very difficulty to use, so I very much suggest trying it out. I hope there's nothing wrong with promoting the libraries that people have created.
Good luck scripting!
Good luck scripting!