now too uses standard c time functions and structures