You can do most of it in Imagemagick. But Imagemagick does not have built-in date-time formatting. So you have to capture the date and time and pipe it to your OS to reformat. Then capture the image name without the suffix. Then convert your input to a new image with the desired output name.
Here is an example using Unix tr to reformat the captured data and time where I change spaces to underscores and colons to hyphens.
datetime=$(identify -format "%[EXIF:DateTime]" P1050001.JPG | tr " " "_" | tr ":" "-")
inname=$(identify -format "%t" P1050001.JPG)
convert P1050001.JPG ${inname}_${datetime}.jpg
This creates a new file with the name of P1050001_2009-12-05_16-59-51.jpg
Alternately, you can combine the first two steps as:
newname=$(identify -format "%t_%[EXIF:DateTime]" P1050001.JPG | tr " " "_" | tr ":" "-")
convert P1050001.JPG ${newname}.jpg
If you do not want to use convert to create a new image, then you can use your OS to rename the original.
All of this may be easier done with exiftool as Mark Setchell has suggested.