[Solved] Converting date serial number to date format

Discuss the spreadsheet application
Post Reply
ahughes
Posts: 4
Joined: Fri Jun 05, 2015 12:01 pm

[Solved] Converting date serial number to date format

Post by ahughes »

I cannot find a function that will convert a date serial number to a conventional date format. I realize that I can construct such a function using the day(), month() and year() functions, but is there really no function built into Calc to do this?

While I haven't found such a function, I have found the method. You simply change the cell format from numeric to date and specify the format. Calc then does the rest.

I'm still curious if there is such a function however.
Last edited by ahughes on Wed Jul 08, 2015 1:51 pm, edited 1 time in total.
OpenOffice 4.1.1 on MacOS 10.7.5
eremmel
Posts: 1080
Joined: Tue Dec 30, 2008 1:15 am

Re: Converting date serial number date format [Solved, sort

Post by eremmel »

In calc a date (with time) is just a number. The number is the offset of days since a predefined date (see options).
You give the meaning of a number as a date by giving it's format (press Ctrl-1 to format).

The difficult thing is that a number can be a number, a date/time or a duration (a date/time offset, or the difference between two dates). The latter can only be expressed in days, hours, minutes, ...
It's Microsoft marketing that tells you computers are qualified for non-technicians
W11 22H2 (build 22621), LO 7.4.2.3(x64)
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Converting date serial number date format [Solved, sort

Post by acknak »

ahughes wrote:I cannot find a function ...
change the cell format from numeric to date and specify the format. ...
TEXT() converts a value to text according to a format string, same as the cell format.

With a date value in A1,

=TEXT(A1;"YYYY-MM-DD")
AOO4/LO5 • Linux • Fedora 23
ahughes
Posts: 4
Joined: Fri Jun 05, 2015 12:01 pm

Re: [Solved, sort of] Converting date serial number date for

Post by ahughes »

Thanks, acknak. That's what I was looking for.
OpenOffice 4.1.1 on MacOS 10.7.5
Post Reply