News for hackers. Stuff that matters.
Re:Maya – Python Datetimes for Humans by StavrosK on Sunday December 18, 2016 @06:42AM (#13205430)
I'm pretty sure that it's 23 because some time passed between keystrokes, so the delta was 23:59:50, and he only keeps the most significant digit. I had to do this exact thing yesterday for timetaco.com.
Re:Maya – Python Datetimes for Humans by prashnts on Sunday December 18, 2016 @06:47AM (#13205449)
Shouldn't it be immutable? I'd expect this to be a default behaviour.
Re:Maya – Python Datetimes for Humans by amjd on Sunday December 18, 2016 @06:59AM (#13205487)
Not in this case. The entire proposition of slang_time is that it returns human readable time difference with respect to now (i.e., the moment when called).
Re:Maya – Python Datetimes for Humans by paulddraper on Sunday December 18, 2016 @07:51AM (#13205633)
In this case, consistency would imply the immutability of time.
Re:Maya – Python Datetimes for Humans by webmaven on Sunday December 18, 2016 @07:04AM (#13205501)
Shouldn't it round up?
Re:Maya – Python Datetimes for Humans by StavrosK on Sunday December 18, 2016 @07:09AM (#13205510)
If it's 01:00:01, is it two hours?
Re:Maya – Python Datetimes for Humans by Redoubts on Sunday December 18, 2016 @11:29AM (#13206335)
If it's 00:59:50, is it 0 hours?

i have the feeling his natural answer to both questions is no...

Re:Maya – Python Datetimes for Humans by webmaven on Sunday December 18, 2016 @12:00PM (#13206470)
Fine, rounding up fails.

Round to nearest time unit, instead.