What's the trick? I need to record the contents of a datetimepicker field to my mysql database in a date field...and there are vague references to it here but nothing spells it out.
Can someone help me out please?
Hi cbehan,
the date format coming out from the picker is not in the mysql format i think so use a VARCHAR field instead!
regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Is there a way to convert it? I need to use the data for some reporting and dates would make it much easier.
I think there is a trick to use, but first try to have a DB field of type VARCHAR, do you get your data saved there ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
If it's a varchar it saves the date to the db in dd/mm/yyyy format.
Hi cbehan,
try this in the onsubmit before email box (assuming you have some email setup in your form ?)
<?php
JRequest::setVar('date_field_name', date('d-m-Y', strtotime(JRequest::getVar('date_field_name'))));
?>
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
right, I see you changed it alittle but I'm not sure if it will work after your changes!
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
I think the strtotime function didn't like something with the string!! :?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.