• Resolved s

    (@sdnazdi)


    Hi,

    I added custom field date, time, date/time to a cpt. I like when i create a post in this cpt, it assign automatically the publish/save/update date, time, date/time of this post to this cf as a default value with possibility to modify manually.

    • This topic was modified 9 months, 2 weeks ago by s.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    In your field settings under Advanced, you can set your “Default Value” to {@date,Y-m-d} (for date) or {@date,Y-m-d H:i:s} (for date/time).

    Also turn on your “Evaluate tags in default values” setting just below that.

    New posts will have that value automatically set in the corresponding form field.

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    If you need any other date format values, you can reference those here: https://www.php.net/manual/en/datetime.format.php

    Rainbow Forge

    (@rainbowforge)

    I’m so sorry if this is user error, but I’m trying to figure out how to add a default time and separately date value, and failing. I’ve tried {@date,12-20-25} for the date, {@date,10-10-25 12:00:00} for the time, and also {@time, 13:00:00} for the time.

    I skimmed the php manual you linked, and it seems more related to the formatting in display instead of the defaults in a pods field? Please let me know if I’m misunderstanding that.

    Thanks so much!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘set the default value for date and time’ is closed to new replies.