Or you could convert the string to Date object then you can use any of the Date functions to extract what you want.
let date = new Date(msg.payload[0].datetime)
But are you sure that the value in the payload is a string and not already a Date? Add the line
node.warn(`type is ${typeof msg.payload[0].datetime}`)
and see what it says.