|  | Posted by Colin McKinnon on 03/12/06 01:03 
Sandman wrote:
 > In article <op.s59iljj9fdqzms@mercury>,
 >  "hugh webster" <hwebster@bluewin.ch> wrote:
 >
 >> MySql seems to only accept dates as 'yyyy-mm-dd'. How do I do that when
 >> the user might input dd/mm/yy, or d.m.yyyy (I'm in Europe)? I know I can
 >> do sscanf, or explode to rebuild the date string - but there must be a
 >> better way. Is there a FAQ somwhere?
 >
 > Well, there is a function - strtotime(), which will take plain english
 > and try to turn it into a timestamp.
 >
 
 Which is very Americanised, and does not have any mechanism for providing a
 hint to the underlying code.
 
 Best solution is not to allow users to enter a date into a text field. An
 ugly solution is to provide dropdowns for day number, month name and year.
 I think the best solution is to use something like Mihai Bazon's jscalendar
 (which was one of the main contributing factors to me writing PfP Studio).
 
 HTH
 
 C.
  Navigation: [Reply to this message] |