Trouble with dates

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sprogget
Forum Newbie
Posts: 2
Joined: Mon Sep 26, 2005 6:37 am

Trouble with dates

Post 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.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

look at the date() and maybe strtotime() function
sprogget
Forum Newbie
Posts: 2
Joined: Mon Sep 26, 2005 6:37 am

Post 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
Post Reply