Notifications
Mark all as read
Q&A

Format NOW function display within concatenation

+0
−1

In a Q on Stack Overflow LibreOffice Calc 5.0.2.2 user @Idad seems to have ended up with this formula:

=CONCATENATE("Printing Date: ",DAY(NOW()),"-",MONTH(NOW()),"-",YEAR(NOW()),"",HOUR(NOW()),":",MINUTE(NOW()))

to produce (back in 2015):

Printing Date: 10-11-15 10:20

Is there a simpler way?

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comments

1 answer

+0
−0

I think so, in LibreOffice Calc 5.4.3.2:

="Printing Date: "&TEXT(NOW(),"dd-mm-yy hh:mm")

or just:

=TEXT(NOW(),"dd-mm-yy hh:mm")

with Format > Cells… > Category User defined and Format code:

"Printing Date: "@

In both cases the format for the volatile NOW is chosen by the user within the TEXT function rather than left to the software's defaults.

A difference between the two options is that the latter preserves the underlying date-time stamp value in case required for further operation.

Why does this post require moderator attention?
You might want to add some details to your flag.

2 comments

I'm not so familiar with LibreOffice, but could you perhaps use =text(now(),"\P\r\i\n\t\i\n\g \D\a\t\e: dd-mm-yy hh:mm") or some such, so that the underlying datetime is in the cell for calculations but one need not search for the cell format to find why it appears as it does? msh210‭ about 1 month ago

@msh210 That works but is slightly longer than ="Printing Date: "&TEXT(NOW(),"dd-mm-yy hh:mm") and looks no different. Searching the format is just "the price to pay" for an underlying 'numeric format' date. I fear I have not comprehended your point (: pnuts‭ about 1 month ago

Sign up to answer this question »