Both were sliced from the year string, so years with other than four
digits gave the wrong century and two-digit year, and %y was a string
that the - and _ flags could not unpad. Compute them arithmetically and
pad them to two digits, matching Ruby's strftime.
str.split(/\s+/) yields a leading empty element when the input starts with
whitespace, so that element was counted as a word and joined back into the
output: " Ground control to Major Tom." truncated to 3 words returned
" Ground control..." instead of "Ground control to...".
Ruby Liquid splits in awk mode, which discards leading whitespace but keeps
trailing whitespace, so trimStart matches it and trim would not.