I'm at present working with an API that returns times (not datetimes, just the hours part) in this format:
{"open":"08:20:00","close":"300"}
I asked about the meaning of "300" to the developers that wrote the API and the answer they gave me is: well, we compute the closing hour with this PHP algorithm:
date('H:i',strtotime('08:20:00')+(300*60))# result is "13:20"
So, instead of writing the actual closing time, they decided to do this, in a REST API.
I wanted to scream :-D
Now I have to figure out how to implement the same thing in Python -_-
Not "clever code" but "clever design".
I'm at present working with an API that returns times (not datetimes, just the hours part) in this format:
I asked about the meaning of "300" to the developers that wrote the API and the answer they gave me is: well, we compute the closing hour with this PHP algorithm:
So, instead of writing the actual closing time, they decided to do this, in a REST API.
I wanted to scream :-D
Now I have to figure out how to implement the same thing in Python -_-
Good luck ;)
I wanted to scream too by reading this!
I feel your pain.
Literally, I shuddered after reading that.