Page 1 of 1

Trouble with dates

Posted: Mon Sep 26, 2005 6:47 am
by sprogget
Warning - I'm a php newbie!

I'm trying to write a program that tells you what phase of the lunar cycle it is.

I'm totally stuck - how can I get php to assign a (variable) number to today's date and then increase that number by one each day until it gets to 28 and then starts again at 0?

It's either fiendishly difficult or ridiculously simple... I'm too new at this to know which! :roll:

Any pointers would be welcomed.

Posted: Mon Sep 26, 2005 6:49 am
by shiznatix
look at the date() and maybe strtotime() function

Posted: Mon Sep 26, 2005 8:53 am
by sprogget
Thanks, I've done it now. I was approaching the whole thing the wrong way. Ended up using unix timestamp. Thanks anyway. :D