Hello,
to me it is important to know, when data (facts) were generated. In particular it is crucial if these facts are stored for example in puppetDB.
Thus I wrote a tiny extension I'd like to share with you. Maybe it is useful for somebody else too.
Facter.add(:facts_timestamp) do
setcode do
report = {}
dt = Time.now
report['Unix timestamp'] = dt.to_i
report['UTC timestamp'] = dt.utc.to_s
report['local timestamp'] = dt.getlocal.to_s
report['local zone'] = dt.getlocal.zone.to_s
report['local dst'] = dt.getlocal.isdst.to_s
report['UTC timestamp array'] = dt.to_a
report['local timestamp array'] = dt.getlocal.to_a
report
end