in reply to Date format YYYY-MM-DD HH-MM-SS

If you have the data in the form returned by localtime, you can format it with the function strftime in POSIX.
Bill