NOW() with a fixed date?

Discuss the spreadsheet application
Post Reply
nownownow
Posts: 1
Joined: Wed Mar 16, 2016 8:49 am

NOW() with a fixed date?

Post 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?
OpenOffice 4.1.2 / Gentoo AMD64
User avatar
karolus
Volunteer
Posts: 1159
Joined: Sat Jul 02, 2011 9:47 am

Re: NOW() with a fixed date?

Post by karolus »

Hallo

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

Karolus
AOO4, Libreoffice 6.1 on Rasbian OS (on ARM)
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
User avatar
Zizi64
Volunteer
Posts: 11358
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: NOW() with a fixed date?

Post 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 254 times
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: NOW() with a fixed date?

Post 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.
AOO4/LO5 • Linux • Fedora 23
User avatar
Zizi64
Volunteer
Posts: 11358
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: NOW() with a fixed date?

Post 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?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
karolus
Volunteer
Posts: 1159
Joined: Sat Jul 02, 2011 9:47 am

Re: NOW() with a fixed date?

Post 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]
AOO4, Libreoffice 6.1 on Rasbian OS (on ARM)
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: NOW() with a fixed date?

Post 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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Zizi64
Volunteer
Posts: 11358
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: NOW() with a fixed date?

Post 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!
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply