# Update a field (#+LAST\_MODIFIED: ) at save

**URL:** <https://org-roam.discourse.group/t/update-a-field-last-modified-at-save/321>\
**Category:** How To\
**Created:** [June 9, 2020, 4:32pm UTC](https://org-roam.discourse.group/t/update-a-field-last-modified-at-save/321 "2020-06-09T16:32:53Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![tea4or2wo](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@tea4or2wo](https://org-roam.discourse.group/u/tea4or2wo)\
**Post date:** [November 11, 2020, 4:51pm UTC](https://org-roam.discourse.group/t/update-a-field-last-modified-at-save/321/19 "2020-11-11T16:51:53Z")

</div>

I’m trying @alexv suggestion which works very well with default `time-stamp-format`:

```
  (add-hook 'org-mode-hook
    (lambda () (add-hook 'before-save-hook 'time-stamp nil 'local)))

  (add-hook 'org-mode-hook
    (lambda ()
      (set (make-local-variable 'time-stamp-pattern)
     	   "7/^#\\+EDITED: %%$"
	   )))

```

but does not work if changing `time-stamp-format` in last but one line:

```
   	        "7/^#\\+EDITED: [%04y-%02m-%02d %3a %02H:%02M]"

```

Any idea how to make it work?

---

_[View the full topic](https://org-roam.discourse.group/t/update-a-field-last-modified-at-save/321)._
