Forum Moderators: coopster

Message Too Old, No Replies

unix to jd, help

         

tresmom5

12:20 am on Oct 11, 2004 (gmt 0)

10+ Year Member



I set up a basic calendar, sort of. Probably not coded the right way, but it was working. I was quite proud of myself for figuring this out and now I feel like a big loser because I didn't realize this whole unix to jd thing. Well, some months the calendar looks right, but other months it'll have two of the same dates on the calendar. Is there anyway to fix this without doing the whole thing over again?

Teresa

coopster

2:53 pm on Oct 11, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



unix to jd thing

?

Can you offer more information, tresmom5? The issue is understood in that your calendaring/dates are duplicating, but it is quite unclear as to how you programmed it.

tresmom5

3:51 pm on Oct 11, 2004 (gmt 0)

10+ Year Member



Basically, it's not a regular calendar. I run a parenting site and I am trying to make a pregancy calendar. So they fill out the form, put in their due date, and voila it starts the calendar out at the first day of their pregnancy. What I did was made the form and made the duedate into an epoch timestamp and basically added one day to it with another epoch timestamp and continued in that pattern adding one. Probably not the most efficient way to do this, but I'm new at this and just trying to make somethign that works. So everything works, except sometimes it will put out two of the same days on the calendar. At this point I think I will have to start over, and I'm ok with that if I can figure out the right way to add dates in a pattern like that dealing with this unix time correctly.

Thanks for taking the time to respond. I appreciate it.

eggy ricardo

6:26 am on Oct 12, 2004 (gmt 0)

10+ Year Member



Hiya,

I have recently made a calendar, and likewise i didn't know how efficient the method would be, but it works.

When i was using values i did something like this...

$cal_date = mktime(0, 0, 0, date("m", $cal_date), date("d", $cal_date)+1, date("Y", $cal_date));

...for incrementing the dates, where $cal_date started as whatever date i wanted to start the calendar on. Then i printed
date("d", $cal_date)
to get the list of numbers.

I also used a lot of (probably inneficient) code to arrange this into monthly grids and do varying formatting things using loops of varying descriptions.

Hope this can help in some way.

Cheers
Richard

tresmom5

12:41 pm on Oct 12, 2004 (gmt 0)

10+ Year Member



Thank you! I will see what I can do with it.

Teresa