Hacker News new | past | comments | ask | show | jobs | submit login

Python 2.7 shows 10,000 days.

    >>> datetime(2011, 9, 30) - datetime(1984, 5, 14)
    datetime.timedelta(10000)



By subtracting the day he was born you're not counting it. You're making it 'day 0'. 2 days - 0 days = 2 days.


Also, Ruby 1.9.2 shows 10,000 days.

    irb(main):017:0> (Time.utc(2011, 9, 30) - Time.utc(1984, 5, 14)) / 60 / 60 / 24
    => 10000.0


So does PHP!

    echo date_diff(date_create('1984-05-14'), date_create('2011-09-30'))->format('%a days');
    => 10000 days
Is this silly yet? ;)




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

Search: