Editor - i need to be INSERT now() in SQL Database
Editor - i need to be INSERT now() in SQL Database
![Mbdesign](https://secure.gravatar.com/avatar/46e18005e32d3b643f33b044badb86d8/?default=https%3A%2F%2Fvanillicon.com%2F46e18005e32d3b643f33b044badb86d8_200.png&rating=g&size=120)
i want to use the Date now() after update an entry, how i can do that?
Field::inst('address_last_modified')
->validator( 'Validate::dateFormat', array(
"empty" => false,
"format" => 'd.m.Y',
"message" => "Bitte folgendes Format yyyy-mm-dd"
) )
->getFormatter( 'Format::date_sql_to_format', 'd.m.Y')
->setFormatter( 'Format::date_format_to_sql', 'd.m.Y')
This discussion has been closed.
Replies
I have been doing this by defining a variable for the date/time at the top of the php script $date = date('Y-m-d H:i:s', time()); and then posting it to the editor field class using $_POST['data']['timesheet']['entry_date'] = $date;.
An example from one of my pages below... I hope that helps.
Nige :P
Please excuse the messy formatting of my answer - I am unsure how to format my posts with proper markdown :(
Edited your post to add the formatting. Code formatting rules are documented here :-).
Allan