Using one of the time related modules to load strftime offers no advantage over the OP's choice of POSIX for the code shown. Perhaps he needs other features of POSIX. I was unaware that the function could be called as a method. Many readers would consider that an advantage.