#!/usr/bin/env awk
#
# End Time - last seen
#
# Dependencies:
#   - basicFlow
#
# Example:
#   - tawk '{ print te() }' file

@include "_validate_col"

function te(        _ms) {
    _validate_col(UnixTimeLast, "UnixTimeLast")
    if ($UnixTimeLast == "UnixTimeLast") return "Date last seen"
    _ms = gensub(/^[0-9]+\.([0-9]{3})[0-9]+/, "\\1", 1, $UnixTimeLast)
    return strftime("%F %T", $UnixTimeLast, 1) "." _ms # UTC
}
