|
|
@@ -227,6 +227,7 @@
|
|
|
now_timestamp/1,
|
|
|
format_date/3,
|
|
|
format_date/4,
|
|
|
+ date_to_unix_ts/3,
|
|
|
date_to_unix_ts/4
|
|
|
]).
|
|
|
|
|
|
@@ -1085,6 +1086,14 @@ format_date(TimeUnit, Offset, FormatString, TimeEpoch) ->
|
|
|
)
|
|
|
).
|
|
|
|
|
|
+date_to_unix_ts(TimeUnit, FormatString, InputString) ->
|
|
|
+ emqx_rule_date:parse_date(
|
|
|
+ time_unit(TimeUnit),
|
|
|
+ "Z",
|
|
|
+ emqx_plugin_libs_rule:str(FormatString),
|
|
|
+ emqx_plugin_libs_rule:str(InputString)
|
|
|
+ ).
|
|
|
+
|
|
|
date_to_unix_ts(TimeUnit, Offset, FormatString, InputString) ->
|
|
|
emqx_rule_date:parse_date(
|
|
|
time_unit(TimeUnit),
|