Did you set up a particular Format style for the field? If so, what did you set it to?
Where have you placed this script?
If in the calculation custom calculation script, then a field with a calculation needs to be updated before the code is executed.
Also you will be using the prior value of the field. If you want the value to when you leave the field or when the form is opened, then use event.value and not the field object's value.
yes, the format set up is the same in the code...mmddyyHHMM