简体   繁体   English

如何从wso2das事件发布者发送的邮件中以可读格式显示时间戳

[英]howto present timestamp in readable format on mails sent from wso2das event publisher

Currently i'm using WSO2DAS event publisher to send mail notifications. 目前,我正在使用WSO2DAS事件发布程序来发送邮件通知。 My problem is that i want to present the value of the event timestamps in a readable format (UTC format maybe) but currently mails are sent with the timestamp in UNIX format. 我的问题是我想以可读格式(可能是UTC格式)显示事件时间戳的值,但是当前邮件是用UNIX格式的时间戳发送的。 Is there any special attribute holding a textual representation of the event timestamp or any function to do this? 是否有任何特殊属性保存事件时间戳记的文本表示形式或执行此操作的任何函数?

You can use currentTimestamp() function for that. 您可以为此使用currentTimestamp()函数。 It gives the timestamp in yyyy-MM-dd HH:mm:ss format. 它以yyyy-MM-dd HH:mm:ss格式给出时间戳。

As an example 举个例子

from inputStream
select time:currentTimestamp() as outputTime
insert into outputStream

Using above queries you can get a human readable timestamp in the mail body. 使用以上查询,您可以在邮件正文中获得可读的时间戳。

For more time related functions refer https://docs.wso2.com/display/CEP410/Siddhi+Extensions#SiddhiExtensions-time 有关更多与时间相关的功能,请参阅https://docs.wso2.com/display/CEP410/Siddhi+Extensions#SiddhiExtensions-time

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

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