Save Date field of Date-Time field?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mudokai
    Member
    • Nov 2025
    • 31

    #1

    Save Date field of Date-Time field?

    For calls, I'd like to create a formula that takes just the MM/DD/YYYY from Date Start and saves it without the HH:mm, is there a formula that could achieve this? Thanks
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1818

    #2
    You can use datetime\format for that, whre you can determine, which part is displayed for your purpose.

    Comment


    • mudokai
      mudokai commented
      Editing a comment
      It's just not doing anything when I use formula on before save...can you provide an example formula?
  • victor
    Active Community Member
    • Aug 2022
    • 1099

    #3
    mudokai,

    Code:
    cYourFieldName = datetime\format(dateStart, 'America/New_York', 'MM/DD/YYYY');
    More about this formula: https://docs.espocrm.com/administrat...datetimeformat.

    Comment


    • rabii
      rabii commented
      Editing a comment
      This won't work as it will throw an error

      Invalid datetime format

      Best way to copy date from a date-time to a date field is by constructing it using formula function date - month and year.
Working...