Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #3194585
Date/Time Stamp
Closed

Comments

  • Geoffrey Stertz started the conversation

    Is it possible to add a time stamp if a user creates a new record on a table? I'd like users to be able to add rows, but then be able to see the date that row was added. Is this possible?

  •  1,693
    Miloš replied

    Hi, Geoffrey

    Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.

    -

    For example, If you need a simple auto pre-populate for the column Date and Time, to be the current Date Time,

    we have this placeholder,

    that you can use as a predefined editor value.

    -

    Here is how you can do it :

    Set column type to DateTime;

    9626039055.png

    Then, in the Editor Type, set as "one line edit",  and set the predefined editor value as the placeholder %CURRENT_DATETIME% :

    1626344206.png

    And then, if someone tries to add a new row,   this column's value will automatically be default as the current date and time :

    7417353783.png

    -

    2.

    There is also a custom SQL workaround, for SQL tables, if you need a 'timestamp' :

    1. Create a column (for example "Updated") in your table

    2. In column settings set the type to be "DateTime" (in the "Data" tab), and in the "Editing" tab set the "Editor Input Type" to "none".

    3. In the database, run this query:

    ALTER TABLE `table_name` CHANGE `updated` `updated` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
    

    Please note that you need to replace 'table_name' with the actual database table name. You can find the database name of the table in the Editing tab above the table, in the "MySQL query name for editing" field.

    -

    Let us know if this is helpful.  Thank you


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables