Clay Icon

Calculating Exact Date from Days Ago Reference

Β·
Β·

if my date shows - 5 days ago how do I get the exact date based on todays date?

  • Avatar of Channeled
    Channeled
    APP
    Β·
    Β·

    To determine the exact date from "-5 days ago" based on today's date, you can use a formula in Clay. Here's how: 1. Create a new column in your table. 2. Use this formula: moment().subtract(5, 'days').format("MMMM D, YYYY") This will dynamically calculate and display the date that was 5 days ago from the current date. The format can be adjusted as needed (e.g., "YYYY-MM-DD" for year-month-day). Alternatively, if you have a "Created At" column, you can reference it like this: moment(Created At).subtract(5, 'days').format("MMMM D, YYYY") If you need further assistance, please request human help by clicking "Talk to a person" in this chat.

  • Avatar of Sunny D.
    Sunny D.
    Β·
    Β·

    its not doing it properly for 20hours as input

  • Avatar of Channeled
    Channeled
    APP
    Β·
    Β·

    To calculate the exact date and time for "20 hours ago" using Clay, you can use the Format Date/Time action. Here's how: 1. Create a new column in your table. 2. Use this formula: moment().subtract(20, 'hours').format() This will dynamically calculate and display the date and time that was 20 hours ago from the current moment. You can adjust the format as needed, for example: ** moment().subtract(20, 'hours').format("YYYY-MM-DD HH:mm:ss") for year-month-day hour:minute:second ** moment().subtract(20, 'hours').format("MMMM D, YYYY h:mm A") for Month Day, Year hour:minute AM/PM If you need further assistance, please request human help by clicking "Talk to a person" in this chat.

  • Avatar of Smit V.
    Smit V.
    Β·
    Β·

    Hi Sunny, thank you for reaching out! Do you mind sending the link (url) to the table so we can take a look?

    (52 kB)
    Image
  • Avatar of Sunny D.
    Sunny D.
    Β·
    Β·

    Hey Smit thanks for following up. I figured it out so we're good. Thanks again

  • Avatar of Smit V.
    Smit V.
    Β·
    Β·

    That's awesome. Glad you were to able to work it out. I'll tentatively mark this closed for the moment, but keep in touch if you hit other roadblocks.

  • Avatar of Channeled
    Channeled
    APP
    Β·
    Β·