public static BigDecimal epoch ( EvaluationContext ctx , Object datetime ) { Instant instant = Conversions . toDateTime ( datetime , ctx ) . toInstant ( ) ; BigDecimal nanos = new BigDecimal ( instant . getEpochSecond ( ) * 1000000000 + instant . getNano ( ) ) ; return nanos . divide ( new BigDecimal ( 1000000000 ) ) ; }
Converts the given date to the number of nanoseconds since January 1st 1970 UTC