代码之家  ›  专栏  ›  技术社区  ›  Jane S.

有没有办法用无痛语言把日期字段转换成不同的时区?

  •  0
  • Jane S.  · 技术社区  · 6 年前

    有没有一种方法可以用无痛的方式转换这些代码? 创建

      "aggregations": {
        "dayOfWeek": {
          "terms": {
            "script": {
              "inline": "doc['created'].date.setZone(org.joda.time.DateTimeZone.forID(tz)); doc['created'].date.dayOfWeek",
              "lang": "groovy",
              "params": {
                "tz": "Europe/London"
              }
            }
          }
        }
      }
    
    0 回复  |  直到 6 年前