Automatically adding current date/time into Date Added and Last Modified fields in Editor

Automatically adding current date/time into Date Added and Last Modified fields in Editor

shawngibsonshawngibson Posts: 28Questions: 8Answers: 0

Hi all,

Is it possible to have a date_added field in a table which is automatically populated with the current date and time upon record creation?

Similarly, can a last_modified field be initially left blank or populated with the same date and time as the date_added field, then similarly time-stamped automatically any time the record is later edited (overwriting any previous last_modified timestamp)?

I'm sure this is quite common, but I'm new at this and not a real programmer by any stretch lol...though I am thoroughly enjoying my new student status thanks to DataTables and Editor.

Merci:)
Shawn

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 57,686Questions: 1Answers: 9,195 Site admin
    Answer ✓

    Hi Shawn,

    Yes indeed this is possible with Editor's server-side libraries. I'm assuming your are using PHP, but if not, let me know. Have a look at this part of the documentation which I believe details exactly what you are looking for.

    Don't have the server-side set fields in the Editor display on the client-side. There is no need for them there and could potentially just confuse the customer.

    Allan

  • shawngibsonshawngibson Posts: 28Questions: 8Answers: 0

    Hi Allan, thanks for your help (again). Yes, I'm running PHP in a XAMPP installation, so the link you provided is perfect. Now off to code...I go.

    Shawn

Sign In or Register to comment.