How can I prevent the value of an automatic field from updating when the file is opened?

I have a document that has an automatic date field. When the document is opened, the data shown is always the current date (i.e. today).

What I want is to be able to see what the value of the field was at the time the document was last saved (say, 6 months ago). I can’t figure out how to do this.

I tried converting the file to plain text and to PDF from the command line and even in those conversions, the field is updated before the file is converted.

Is there a setting in LibreOffice that prevents the field value from being updated from its previous value? Is it even possible? I have a suspicion that the value of the field isn’t actually saved at all when the file is saved. Is this true?

I can only infer from the file modification time what the value of the field might have been. Is this my only option?

Thanks to all who reply.

A fixed field in a template (.ott), starts a new document with the current date and keeps the date when the document (.odt) is stored to disk.
A date field that is not fixed, always displays the current date.

There are two Date fields: one “fixed”, the second “dynamic”.

When you Insert>Field>Date, the “fixed” variant is inserted. It retains the date of insertion.

If you Insert>Field>More Fields, Document tab, Type Date, you can choose between Date (fixed) and Date (dynamic variant).

If you chose the wrong variant, double-click on the field and change its behaviour. Naturally, this will not restore the initial value, just freeze the value to today. And you can always replace the field by a date string which will effectively make the date unchangeable.

You didn’t mention OS name, LO version and save format. It is possible that in DOCX date/time fields cannot be frozen. I didn’t check.

@ajlittoz: I doubt the issue would be specific to a particular OS or LO version but the document is on a Windows 11 machine running LO 7.6.4.1.

In any case, I just tried opening the exact same document on a linux box (Ubuntu 22.04LTS) running LO 24.2.1.2 and the result is the same.

The field is indeed not “fixed”.

So, I guess the answer is no, I cannot see the value of the data in the field that was displayed at the moment the file was saved.

I didn’t create this document; perhaps in this case it would have been better to use a fixed field.

Thanks to all who weighed in.

A very important factor is: is it saved .odt or .doc(x)? In the latter case, compatibility issues come into play.

In adition to the answer of @ajlittoz i suppose an similiar answer:
Choose “Insert”>“Field”>“More Fields”, then select tab “DocInformation”
In the left part of the window under “Type” you can choose “Modified” and in “Select” choose “Date” and a format. Insert into the Document.
It gives you the date of the last modification (save) of the document.
If you close without to save, nothing will change.
If you made a modification and save, then the inserted datefield will be actualised.

2 Likes

All the answers and comments to my question seem to suggest that I was asking for a solution how to pick a different kind of field with the behaviour I wanted. That’s not what I was asking.

I was asking if there is a way to view an existing document, saved at another time, without actually changing this document. In other words, is there a way to prevent the date information that appeared in the field at the time the file was last saved from being lost when I opened the document?

So, as far as I can tell, the answer to this is no, I can’t.