Inserting a code for today's date

Is there any way I can insert code so that when I open a template the date is the date that the document is opened rather than the date it was created ?

=TODAY()

Hi :slight_smile:
Doesn't just
Insert - Fields - Date
do the trick?  Does that just insert the date today and then not update in the future?  It should update but i have a funny feeling it doesn't work as intended so i'm curious to know if that hasn't worked for you. 
Regards from
Tom :slight_smile:

That will give the current date you inserted the date into the document, but not update it when you use the template later. I tried that once and it did not work.

I never tried the =TODAY()
in my template, or know how to insert it in a Writer template. That looks like it is made for a Calc spreadsheet template.

I use the Insert Fields a lot of times. Date, Page number and count, etc., etc., for my documents, but never in a template when the date and time must be updated every time I use the template or do any editing of the document and need the date/time be reflected automatically.

Ah, yes my mistake for assuming what you were using. I'll have to look into
writer. I just tried inserting a table (1x1) and putting the formula, no
good.

Regards,
Joel

Are trying to date stamp (does not change) the document with the date it was created not the date the template was created?

Have you saved your template using File -> Templates -> Save? This will save it in the LO User folder. Then you can access it using File -> New -> Documents and Templates.
      If you have already done this, you edit the template. File -> Templates -> Organize. Click the template from within the My Documents folder (in the list on the left). Then click the Edit button. When you complete these steps, click Save and close the template.

  Do one of these 2 to open the Fields dialog:
1) Insert -> Fields -> Others
2) Control+F2
      Working with the dialog:
1) Click the Documents tab.
2) Type: Date
3) Select: Date
4) Format: Select the format you want to use. (You can even create your own format if you want.

      --Dan

Joel Madero wrote:

Ah, yes my mistake for assuming what you were using. I'll have to look into
writer. I just tried inserting a table (1x1) and putting the formula, no
good.

Regards,
Joel
  

<snip>

Joel et al,
Curious, I tried "=TODAY()" as a field variable formula and it doesn't work, with or without the "=". Inserting a table is a brute force method, but as you say, it doesn't seem to work either. Writer's tables are a subset of Calc tables and "=TODAY()" may not be a supported formula. A better approach might be to:

   1. Place the cursor where you want the date.
   2. Select Insert -> Fields -> Other
   3. Select the "Document" tab
   4. Select "Date" for "Type"
   5. Select "Date" for "Select"
   6. Choose your date format under "Format".
   7. Click on "Insert".

If in step #5 you select "Date (Fixed)", I think that will insert today's date but it will not update in future edits. Even this procedure may not work in a template. More investigation is needed.
Hope this helps.
Girvin Herr

When you open the template, both these dates are the same! Templates are used only to create new documents, so the document is created at the point that the template is opened. But I think I see what you mean. You want a template containing a date field such that any document created from that template will, after it is saved and reopened, show the date that the document was reopened (and then reopened and reopened) and not initially created from the template.

As has already been suggested by others, you can do that at Insert | Fields > | Other... | Document. Under Type select Date and under Select select Date - not "Date (fixed)". One point of confusion is that at Insert | Fields > you will see a Date entry - but this is actually the "Date (fixed)" variety, not the (variable) Date that you need. So ignore that and proceed to Other... .

I trust this helps.

Brian Barker

works, thanks

bill

Yup, that works.
Thanks

bill

Thanks Brian, that works.
(this may be a duplicate as the first reply I sent seems to have gotten lost in cyberia.

When I last used it, the "Date (Fixed)" inserted the date on the day its set
up and does not update the date. If you select "Date" it changes the date
everytime the document is opened, also changes it when person recieving the
document recieves it, I'm told.

I send out a newletter each month and the date is changed each time I update
it before I send it and then when it goes out.

upscope wrote:

  

Joel Madero wrote:
    

Ah, yes my mistake for assuming what you were using. I'll have to look
into
writer. I just tried inserting a table (1x1) and putting the formula, no
good.

Regards,
Joel
      

<snip>

   1. Place the cursor where you want the date.
   2. Select Insert -> Fields -> Other
   3. Select the "Document" tab
   4. Select "Date" for "Type"
   5. Select "Date" for "Select"
   6. Choose your date format under "Format".
   7. Click on "Insert".

If in step #5 you select "Date (Fixed)", I think that will insert
today's date but it will not update in future edits. Even this
procedure may not work in a template. More investigation is needed.
Hope this helps.
Girvin Herr
    

When I last used it, the "Date (Fixed)" inserted the date on the day its set up and does not update the date. If you select "Date" it changes the date everytime the document is opened, also changes it when person recieving the document recieves it, I'm told.

I send out a newletter each month and the date is changed each time I update it before I send it and then when it goes out.
  

upscope,
Yes, this is true. That is why I personally don't use "Date" as opposed to "Date (Fixed)" on my documents. If the document is a one-time simple document, such as a letter where the date is used once and not throughout a multi-page document, I usually just type the date in and edit it each time I revise the document. That way it doesn't unexpectedly change on me. Using the auto change date form caused me headaches in this respect.

Another option I use is the document properties feature. I create a custom version date property

    File -> Properties
    "Custom Properties" tab

and then insert that property as a field.

    Insert -> Fields -> Other
    "DocInformation" tab
    "Custom" type

Then I only need to change the one property to change any and all instances in the document. Works for me. It also works in headers and footers.

While verifying this just now, I noticed some other fields in the Docinformation" tab I will have to investigate: "Last Printed" and "Modified" may be of interest to this thread.
Hope this helps.
Girvin Herr