public class TryEpochOperator extends Object
This operator tries many known patterns to find out the right one. Once found that pattern will be reused for achieving maximal performances.
[mytimestamp] = tryEpochSec([user][date]);
To get it using in milliseconds use:
[mytimestamp] = tryEpochMs([user][date]);
You can also provide default values as follows:
[mytimestamp] = tryEpochSec([user][date], 0L);
| Constructor and Description |
|---|
TryEpochOperator(IRuntimeContext r,
int l,
boolean useSeconds)
Ctor
|
public TryEpochOperator(IRuntimeContext r, int l, boolean useSeconds)
r - the punchlet runtime contextl - the caller punchlet line numberuseSeconds - true to return the result as secondspublic Long tryEpoch(Tuple t, long defaultValue)
t - the input tupledefaultValue - the default value to return if there is no matchpublic Long tryEpoch(String source)
source - a date as a stingCopyright © 2023. All rights reserved.