# Datetime lässt sich nicht speichern

**URL:** <https://forum.shopware.com/t/datetime-lasst-sich-nicht-speichern/60435>\
**Category:** Programmierung\
**Created:** [15. Juli 2019 um 08:43 UTC](https://forum.shopware.com/t/datetime-lasst-sich-nicht-speichern/60435 "2019-07-15T08:43:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pino](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/pino/32/14373_2.png) [@pino](https://forum.shopware.com/u/pino)\
**Post date:** [15. Juli 2019 um 08:43 UTC](https://forum.shopware.com/t/datetime-lasst-sich-nicht-speichern/60435/1 "2019-07-15T08:43:45Z")

</div>

Tach zusammen,

ich versuche Datetime zu speichern.

EntityDefinition

```
protected function defineFields(): FieldCollection
    {
        return new FieldCollection(
            [
                (new IdField('id', 'id'))->addFlags(new PrimaryKey(), new Required()),
                new CreatedAtField(),
                new UpdatedAtField(),
....
            ]);
    }

```

&nbsp;

Admin

&nbsp;

Request-Payload

```
{updatedAt: "2019-07-08T08:39:00+00:00"}

```

&nbsp;

Mit oder ohne :config

```
:config="{dateFormat: 'Y-m-d H:i:S', altFormat: 'd.m.Y H:i:S'}"

```

Nichts passiert.

Alle anderen Daten (z.B. Name, Status) werden schön brav gesichert.  
Kann mir jemand sagen, was falsch sein könnte.

---

<div class="post-metadata">

**Author:** ![pino](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/pino/32/14373_2.png) [@pino](https://forum.shopware.com/u/pino)\
**Post date:** [15. Juli 2019 um 09:14 UTC](https://forum.shopware.com/t/datetime-lasst-sich-nicht-speichern/60435/2 "2019-07-15T09:14:23Z")

</div>

Sorry, da war ich mal wieder schneller als nötig.

Hab eine neue Spalte “Datum” (Datetime) angelegt.

```
return new FieldCollection(
    [
        (new IdField('id', 'id'))->addFlags(new PrimaryKey(), new Required()),
        new CreatedAtField(),
        new UpdatedAtField(),
        (new DateTimeField('datum', 'datum')),
...
    ]);

```

&nbsp;

&nbsp;

natürlich geht das jetzt.

```
 createdAt und updatedAt zu verändern, macht ja null Sinn.

new CreatedAtField(),
new UpdatedAtField(),

```

&nbsp;

~closed~
