【问题标题】:Convert Timestamp format in elasticsearch在elasticsearch中转换时间戳格式
【发布时间】:2021-09-26 21:37:00
【问题描述】:

我想将“2020-06-16T20:29:56.256+10:00”格式改为“2020-06-16T20:29:56.256Z”这种格式。如何在 Elasticsearch 查询中做到这一点。 请帮忙,

【问题讨论】:

    标签: elasticsearch time timestamp


    【解决方案1】:

    您可以使用customized date format,如下面的索引映射所示

    {
      "mappings": {
        "properties": {
          "timestamp": {
            "type": "date",
            "format": "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
          }
        }
      }
    }
    

    【讨论】:

    • @Dinusha Kulathunga 你有没有机会回答这个问题,期待得到你的反馈:-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-15
    • 2015-09-08
    • 2011-09-18
    • 2020-07-01
    • 2016-11-14
    • 1970-01-01
    • 2019-05-21
    相关资源
    最近更新 更多