switch datetime to use a stack buffer