Factor out memory allocation in formatUnixTime and formatUnixTimeGMT into a helper function. Change the maximum number of characters to be copied into the buffer to 80 and use the total number of characters copied to resize the buffer before building a ByteString.
Factor out memory allocation in formatUnixTime and formatUnixTimeGMT into a helper function. Change the maximum number of characters to be copied into the buffer to 80 and use the total number of characters copied to resize the buffer before building a ByteString.

kazu-yamamoto/unix-time,kazu-yamamoto/unix-time,archblob/unix-time