mlr --csv put '$ts = sec2gmt(1700000000)' data.csv

Category: Data Science & Analysis

mlr --csv put '$ts = sec2gmt(1700000000)' data.csv

Convert a Unix timestamp column to GMT time

The sec2gmt function converts a Unix epoch timestamp, seconds since 1970, into a human-readable GMT date and time. Here the literal 1700000000 becomes a fixed timestamp column for every row; reference a field like $ts instead to convert real data. Miller ships a library of such functions for dates, strings, and math. Use gmt2sec for the reverse direction.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.