// This file is autogenerated, DO NOT EDIT
// mapping/types/date.asciidoc:41

[source, python]
----
resp = client.indices.create(
    index="my-index-000001",
    mappings={
        "properties": {
            "date": {
                "type": "date"
            }
        }
    },
)
print(resp)

resp1 = client.index(
    index="my-index-000001",
    id="1",
    document={
        "date": "2015-01-01"
    },
)
print(resp1)

resp2 = client.index(
    index="my-index-000001",
    id="2",
    document={
        "date": "2015-01-01T12:10:30Z"
    },
)
print(resp2)

resp3 = client.index(
    index="my-index-000001",
    id="3",
    document={
        "date": 1420070400001
    },
)
print(resp3)

resp4 = client.search(
    index="my-index-000001",
    sort={
        "date": "asc"
    },
)
print(resp4)
----
