Updated to use string functions from time.h