On 2025-02-01 08:55, Uwe Brauer via General discussions about Org-mode. wrote:
Is there any way to insert a header and automatically a timestamp with
date/time?

I can write me a small function doing this and bind it to some unused
key, but is there a more general/elegant way I just miss?

Hi Uwe,

TL DR; I add the timestamp automatically on entry creation as a hook [2], in fact, I have several hooks on entry creation and I think is a good way to handle this. I am happy with my setup since I started using it in 2023.

Let me share my experience on that topic (and very happy to hear other experiences and/or feedback), I hope the offtopic inside is welcome and useful:

1. Before, I was manually adding timestamp headers as a postfix for the creation of the header (and this is how I reverted using this script per target buffer [1]) to transform to CREATED properties (see here the automation on how I add the timestamp automatically on entry creation [2]), which I think are even better, specially, because then you can add that column to your table-reports such as clocktable, org-ql, propview, custom org-map-entries stuff.
2. After, as a prefix, in the journal files, for facilitating alphanumeric sorting of items in my customized journal (with a structure of year > week > day). I finally got rid of that, and brain and eyes appreciated that movement, it is too much noise to see a lot of items with timestamp. I discovered that problem when I started using variable-pitch mode, which with modes themes works very nice with (enable variable: (setq modus-themes-mixed-fonts t) ). Then, alternatively, sorting can be done by adding "SCHEDULED" to all items created on certain buffers and levels [3], which I also add for certain org-agenda files (then I use schedule as a poor's man alternative to anki [4] for space repetition [5], which could of course involve real tasks and projects apart from the typical usecase of memorizing concepts).

I do it this way and it works fine for me since that date I use it:

Cheers,
pinmacs



[1] see attached file: migrate-from-ts-header-to-created-property.org

[2] see attached file: auto-insert-created-timestamp-as-property.org

[3] see attached file: autoadd-scheduled-entry

[4] https://en.wikipedia.org/wiki/Anki_(software)

[5] https://en.wikipedia.org/wiki/Spaced_repetition