Calendar rendering problem

I take advantage of this thread to try to solve another problem:
I have a datetime field in my sql database (Frame 1)
In the calendar (timezone=local / locale=italian) I get a different time (Frame 2)
When I select from the database it appears in the format of frame 3
How can I format it to insert it inside the textbox in datetimelocal format?