简体   繁体   English

WSO2 DSS将时区信息附加到mysql日期结果

[英]WSO2 DSS appends timezone information to mysql date result

So I'm trying to use dates with mysql on the wso2 dss. 因此,我正在wso2 dss上尝试在mysql中使用日期。 Simple code 简单的代码

<query id="testDates" useConfig="PORTFOLIOS_DS">
<sql>
  SELECT DATE(date) AS date FROM dateTest
</sql>
<result element="jsonObject" rowName="jsonArray">
  <element column="date" name="testDate" xsdType="date"/>
</result>
</query>

So it returns "2015-03-10-04:00" which isn't considered a valid date my many libraries (momentJS in particular) and to be fair it is a strange format, why do I care about timezone without the time. 因此它返回"2015-03-10-04:00" ,这不是我的许多库(尤其是momentJS)的有效日期,并且公平地讲,这是一种奇怪的格式,为什么我会在没有时间的情况下关心时区。

Does anyone know why it is appending the timezone, how can I prevent the appending of timezone to dates but leave it on datetimes? 有谁知道为什么要附加时区,如何防止将时区附加到日期,却保留在日期时间?

I was able to reproduce this issue with DSS 3.5.0 version. 我能够使用DSS 3.5.0版重现此问题。 So I have already created a public JIRA ticket [1]. 因此,我已经创建了一个公共JIRA票证[1]。 and once this is fixed I will notify you. 一旦解决,我会通知您。

In the meantime as a workaround, I would like to suggest to use an XSLT transformation to trip off timezone information. 同时,作为一种解决方法,我建议使用XSLT转换来触发时区信息。 For more information about how to use XSLT inside the DSS server please refer [2] 有关如何在DSS服务器中使用XSLT的更多信息,请参考[2]。

[1]. [1]。 https://wso2.org/jira/browse/DS-1191 https://wso2.org/jira/browse/DS-1191

[2]. [2]。 https://docs.wso2.com/display/DSS350/XSLT+Transformation+Sample https://docs.wso2.com/display/DSS350/XSLT+Transformation+Sample

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM