Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Silverstripe 2.3.1 will only save Date Field as 1970-1-1


Go to End


974 Views

Avatar
drawde83

Community Member, 1 Post

21 July 2013 at 5:01pm

Edited: 21/07/2013 5:02pm

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.