Answers.Body: <p>This works as a rewrite rule for a search display but see caveats below. Replace the Y-m-d with whatever date format you like.</p>
  <p><code>{capture assign=&quot;step1&quot;}{&quot;[start_date]&quot;|date_format:&quot;%s&quot;}{/capture}{capture assign=&quot;step2&quot;}{$step1-7*24*60*60}{/capture}{$step2|date_format:&quot;%Y-%m-%d&quot;}</code></p>
  <p>Caveats:</p>
  <ul>
  <li>Will eventually stop working in a future version of php (the date_format modifier uses strftime which is deprecated in php 8)</li>
  <li>In certain rare situations in leap years and for dates crossing DST boundaries it may be off by 1 day.</li>
  <li>&quot;%s&quot; isn't available on all systems (e.g. windows)</li>
  </ul>
  <p>The last two may not be of much concern. The first one depends on how aggressively you like to update php version.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-26T14:03:36.253Z
Answers.Text: thank you!  That's a great answer, and it works beautifully.  The only issue that I'll need to eventually deal with is php8, and I'm sure there will be a workaround. Much appreciated!
Answers.UserDisplayName: shibetpc
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-26T04:57:47.203Z
Answers.LastActivityDate: 2023-02-26T04:57:47.203Z
Answers.UserDisplayName: Demerit
Body: <p>How can I rewrite the date in search kit so that it displays a date '7 days prior'? Field is [start_date] of an event.  One week before is the deadline for submissions.  I just want to display that date.</p>
  <p>Any insight appreciated.</p>
  
Tags: <searchkit><dates>
Title: Search Kit - rewrite date to display one week earlier
ThreadText: # Search Kit - rewrite date to display one week earlier
  
  (Asked by: username_0 on 2023-02-25)
  
  How can I rewrite the date in search kit so that it displays a date '7 days prior'? Field is [start\_date] of an event. One week before is the deadline for submissions. I just want to display that date.
  
  Any insight appreciated.
  
  **Tags:** searchkit, dates
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-02-26. Score: 0 | Accepted answer
  
  This works as a rewrite rule for a search display but see caveats below. Replace the Y-m-d with whatever date format you like.
  
  `{capture assign="step1"}{"[start_date]"|date_format:"%s"}{/capture}{capture assign="step2"}{$step1-7*24*60*60}{/capture}{$step2|date_format:"%Y-%m-%d"}`
  
  Caveats:
  
  * Will eventually stop working in a future version of php (the date\_format modifier uses strftime which is deprecated in php 8)
  * In certain rare situations in leap years and for dates crossing DST boundaries it may be off by 1 day.
  * "%s" isn't available on all systems (e.g. windows)
  
  The last two may not be of much concern. The first one depends on how aggressively you like to update php version.
  
  > **Comments:**
  > **username_0**: thank you!  That's a great answer, and it works beautifully.  The only issue that I'll need to eventually deal with is php8, and I'm sure there will be a workaround. Much appreciated!  
  
  ---
  
  