Date format in public update field

5 posts by 3 authors in: Forums > CMS Builder
Last Post: January 27, 2010   (RSS)

By InHouse - January 22, 2010

Hi all,

We'd like to post a front-end page on several sites which allow users to post event info to the CMS for moderation and approval. Have most of the needed parts in place but would like some guidance on date fields.

Can you suggest a best practices method to expose date fields in our form, then validate that and massage it into shape for inclusion in a CMSB article? I think strtotime() is the way the backend manages things but I'd like to hear from the experts.

Am considering some jQuery calendar options and would welcome suggestions in that direction also (as a noob jQuery user).

Many thanks,

Re: [InHouse] Date format in public update field

By Chris - January 25, 2010 - edited: January 25, 2010

Hi J,

Can you send me what you've got already?

EDIT: now I have coffee.
All the best,

Re: [InHouse] Date format in public update field

By Dave - January 27, 2010

Hi Jayme,

The key thing is that when you INSERT or UPDATE a record in MySQL the date is in this format: YYYY-MM-DD HH:MM:SS

You can see some sample code here for generating date fields:

Let me know how far you get with that and any additional questions you might have.

Hope that helps!
Dave Edis - Senior Developer

Re: [Dave] Date format in public update field

By InHouse - January 27, 2010

Thanks Dave! That's the main thing to get right. I appreciate the clarification.