Implement timedeltas for to_json

Closes #9027
ahhh right..either way