NYCPHP Meetup

NYPHP.org

[nycphp-talk] I need a date...sorta...

Chris Bielanski Cbielanski at inta.org
Tue Nov 30 09:12:43 EST 2004


My advice is KISS, Leam...
Create both a start date and end date input rather than fight with leap
days, long months, time zones, and other holiday weirdnesses (relgious /and/
federal). That's how I approach it here. Admittedly, I have to have a
resolution of minutes, and not days, because I track sessions within events
as well as the event dates.

Besides, given half a chance, the user will put in the wrong number of days
a certain percentage of the time, rendering your calculations null (and of
course since this is PHP, only null, not void ;) ) Meeting planners are not
the brightest apples in the barrel.


Thanks,
Chris Bielanski
Web Programmer, 
International Trademark Association,
1133 Avenue of the Americas, 33rd Floor
New York, NY 10036
+1 (212) 642-1745, f: +1 (212) 768-7796
mailto:cbielanski at inta.org, www.inta.org  
INTA -- 125 Years of Excellence



> -----Original Message-----
> From: leam at reuel.net [mailto:leam at reuel.net]
> Sent: Tuesday, November 30, 2004 6:46 AM
> To: talk at lists.nyphp.org
> Subject: [nycphp-talk] I need a date...sorta...
> 
> 
> Trying to drink less coffee in the morning, not sure it's 
> wise to post.  :)
> 
> I'm trying to write an entry form that lets people enter 
> future dates for an event. Most events are 1-4 days in 
> length, which means they may start in one month and end in 
> another. This form will submit to a MySQL databse, and 
> another page will pull out the event information with start 
> and end dates.
> 
> So if I'm going to have an event on 15 January 2005, and my 
> event will last 4 days, the web page that shows my event will say:
> 
> 	leam's Event, 15-18 Jan 2005
> 
> Of course, if my events begins on 30 Jan and goes for 4 days, 
> it should put 31 Jan-2Feb 2005. I think I can make the Month 
> and Year check itself and not print if they're the same. What 
> I don't yet know is the best way to let a user input the 
> date. The first thought that comes to mind is an html 
> selection for each thing, "day" with 31 options, "month" with 
> 12, etc. Ideally the form will be used outside the US so the 
> whole issue of how to spell months and what order things go 
> in has already cropped up. I don't have any translators so 
> everything will be in english. 
> 
> Any suggestions?
> 
> ciao!
> 
> leam
> 
> p.s. For once I'm not in a rush. I've set no promised date 
> for this so I have time to think it through. If there's a 
> function or web page I should read, point me to it!
> 
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.newyorkphp.org
> 



More information about the talk mailing list