tags:

views:

27

answers:

2

I have something like that:

to_days(now()) < to_days(birth)

It work but instead of comparing days I was to compare the time too. Is there a similar function?

A: 

Are you looking for DAYOFYEAR() function ? http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_dayofyear

a1ex07
+1  A: 

Why don't you just use:

birth > NOW()
Quassnoi
+1 and use an index!
KM
Because I need to subtract 15 days to the death field, than compare it:birth <= now( ) AND now( ) < (death - 15)
rtacconi
Your answer is correct. I want to add the to modify a date and compare it is easy: (birth + INTERVAL 15 DAY) > NOW()I add 15 days to birth and compare if is equal to current date and time.
rtacconi