Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But you can make an equally succinct argument in the opposite direction, namely to treat time values as polar coordinates. Then they indeed form an abelian group:

    a + 0:00 = a
    15:00 + 13:00 = 02:00
    12:00 + 12:00 = 00:00
The examples are for hours only, but you can extend it for minutes too. Showing that time values on a clock forms an abelian group under addition is a textbook example everyone uses when introducing group theory.


But it's wrong.

I'll assume the times you gave were in the UK's timezone. Here they are rewritten to use Germany's timezone.

    a + 1:00 = a
    16:00 + 14:00 = 03:00
    13:00 + 13:00 = 01:00
Still think this makes sense?

Time deltas? Then you don't have the timezone or epoch problem. Works fine.

But time stamps? You can't add two time stamps and get a sensible answer.

Time stamps form a torsor, not a group: http://math.ucr.edu/home/baez/torsors.html


You're right, but time values with timezones are completely different types from time values without. They follow different rules and need to be treated differently.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: