Silverstripe 2.3.1仅将日期字段保存为1970-1-1

When I save an DataObject with a Date field from a form it gets saved as 1970-1-1.

It's a standard

public static $db = array(
  'MyDate' => 'Date'
);

then

$form->saveInto($obj);
$obj->write();

although both stages (saveinto,write) seem to change the value to 1970. I realise this is not much to go on so I guess I'm after suggestions for how to debug it.

it's using the ecommerce and payment modules.

The docs (http://api.silverstripe.org/2.4/class-Date.html) state "The field currently supports New Zealand date format (DD/MM/YYYY), or an ISO 8601 formatted date (YYYY-MM-DD)"

If the date is being saved as epoch default, it is likely that it's being passed in in an incorrect format. This could be due to a locale difference between your server and the date format that the data type expects.

You'll need to see the format of $obj->MyDate and manipulate it before calling $form->saveInto() so the date is saved in the correct format.