Closed alexjfisher closed 9 months ago
To be clear, seconds since the epoch are the same everywhere. Timezone is not relevant.
I'm not entirely sure this is true. I think epoch has a timezone, so the way it could work is that you set the local timezone (like Europe/Amsterdam
). Then when you get the current time would convert it to Epoch's timezone. Then convert that time to seconds. That's the only way that I can think of that the timezone parameter makes sense, but it is confusing to say the least (as all timezones are).
time
was both an old API ruby function, and not needed since Puppet 4.In this commit, the
parser
function is removed and replaced by a non-namespaced APIv4 function. This is done to preserve compatibility before the function is removed completely in a later release.The ruby function calls a Puppet language function which implements the existing behaviour using core Puppet functionality.
The original function did something weird with an optional
timezone
parameter. Nobody really remembers why. It appears that very early versions of Ruby may have been buggy and needed this as a workaround.To be clear, seconds since the epoch are the same everywhere. Timezone is not relevant.
Additional Context
Also see https://github.com/puppetlabs/puppetlabs-stdlib/commit/ad4ca4cc3486b0eaaa813595907521ce35c970ce This also relates to https://github.com/puppetlabs/puppetlabs-stdlib/issues/1260 as it removes another function completely from
lib/puppet/parser/functions
.