Page 1 of 1

NOW() with a fixed date?

Posted: Wed Mar 16, 2016 8:54 am
by nownownow
How can I avoid NOW() fields being recalculated to the current date every time?
I want to enter the current timestamp once and it should stay fixed forever.
The only "solutions" I found were for OO 2.x and involved messing around with macros, which is just ridiculous.
Is there an easy way to solve this in OO 4.x?

Re: NOW() with a fixed date?

Posted: Wed Mar 16, 2016 10:00 am
by karolus
Hallo

Type: =now() … <F9> … <enter> … <enter>

Karolus

Re: NOW() with a fixed date?

Posted: Wed Mar 16, 2016 10:57 am
by Zizi64
viewtopic.php?f=9&t=35236

...Or you can type-in the actual date-time value manually... :)

But the most efficient way to create a macro, what will insert the actual date-time value into the selected (active) cell.

For beginners - with the macrorecorder:
https://scito.ch/content/insert-current ... ffice-calc



If you can use the API functions:

Code: Select all

Sub Timestamp

	oCell = ThisComponent.getCurrentSelection()
	oCell.setValue(DateValue(Now)+TimeValue(Now))
end sub
an example file:
Timestamp.ods
(11.59 KiB) Downloaded 258 times

Re: NOW() with a fixed date?

Posted: Wed Mar 16, 2016 2:03 pm
by acknak
If this function is important for you, you may want to try Libreoffice: it comes with this feature built-in and configured with a shortcut key.

Re: NOW() with a fixed date?

Posted: Wed Mar 16, 2016 2:20 pm
by Zizi64
Libreoffice: it comes with this feature built-in and configured with a shortcut key.
Do you mean the 'fixed Date-Time fields' function of the LO? How you can insert them in a Calc cell?

Re: NOW() with a fixed date?

Posted: Wed Mar 16, 2016 2:31 pm
by karolus
Zizi64 wrote:
Libreoffice: it comes with this feature built-in and configured with a shortcut key.
Do you mean the 'fixed Date-Time fields' function of the LO? How you can insert them in a Calc cell?
No, its only 2 predefined Entries for →Tools→Customize→Keyboard…→→insert→[current_Time|current_Date]

Re: NOW() with a fixed date?

Posted: Wed Mar 16, 2016 2:41 pm
by Villeroy
karolus wrote:
Zizi64 wrote:
Libreoffice: it comes with this feature built-in and configured with a shortcut key.
Do you mean the 'fixed Date-Time fields' function of the LO? How you can insert them in a Calc cell?
No, its only 2 predefined Entries for →Tools→Customize→Keyboard…→→insert→[current_Time|current_Date]
Wow. It can insert either the time or the date or a date text field borrowed from the Writer component. But it can not insert a time stamp (date + time) which is what virtually everybody wants.

Re: NOW() with a fixed date?

Posted: Wed Mar 16, 2016 2:46 pm
by Zizi64
Ahh yes, I see now: In the HUN version of the LibreOffice there are two predefined shortcut keys for the date and the time.

Ctrl-. (dot) → Date (formatted: "YYYY-MM-DD")
Shift-Ctrl-. → Time (formatted: "HH:MM:SS")


I do not remember these functions. Thank you for the information!