Server script problem to create datetime

the script worked properly but it did not work in the server script doctype because when you save the doc then faced the ImporrError.

Main issue is: