Hi
Using the "DB Read" action, I'm able to read a date value from a DB record based on the value of a GET variable passed in the form URL, it's returned in the format "2014-10-26 00:00:00".
I can use the value returned to populate a form field (a text box) by naming the form field the same name as the DB field that contains the date read. So far so good.
What I'd like to do is display the date returned as say "Sunday, October 26, 2014" instead of the raw DB format.
I tried setting a date_format command in the field list of the DB Read action "DATE_FORMAT(study_date,'%W, %M %e, %Y) AS date" but it didn't work. study_date is the DB field name.
Any ideas how I could do this? I have no php experience.
Cheers
Using the "DB Read" action, I'm able to read a date value from a DB record based on the value of a GET variable passed in the form URL, it's returned in the format "2014-10-26 00:00:00".
I can use the value returned to populate a form field (a text box) by naming the form field the same name as the DB field that contains the date read. So far so good.
What I'd like to do is display the date returned as say "Sunday, October 26, 2014" instead of the raw DB format.
I tried setting a date_format command in the field list of the DB Read action "DATE_FORMAT(study_date,'%W, %M %e, %Y) AS date" but it didn't work. study_date is the DB field name.
Any ideas how I could do this? I have no php experience.
Cheers
Hello pharms,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How can I format a date in the datepicker?
P.S: I'm just an automated service😉
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How can I format a date in the datepicker?
P.S: I'm just an automated service😉
Hi pharms,
You can change the value using php in a "custom code" action before the "html" action:
Regards,
Max
You can change the value using php in a "custom code" action before the "html" action:
<?php
$form->data["field_name"] = date("format here", strtotime($form->data["field_name"]));
Regards,
Max
This topic is locked and no more replies can be posted.
