simple datetime utility with C implementation