Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


At 15:05 13/01/2017 -0500, Charles Marcus wrote:
Ok, this is really driving me nuts...

Given:
=MONTH(NOW())
results in the number of the current month (1, for January) I want to simply translate this to the monthname, so I used:
=TEXT(MONTH(NOW()),"MMM")
this almost gives me what I want, but it results in "Dec", instead of "Jan" - W[hat is happening here]?

You are guilty of overkill. The TEXT() function with format "MMM" will extract the abbreviated month name from a *date*, so you don't need to use the MONTH() function to do that bit first. As someone has said, all you need is
=TEXT(NOW(),"MMM")

If you use the MONTH() function first, you do indeed get the number 1 for (the current) January, of course, but the TEXT() expression then interprets this 1 as a date, not a month number. Date/time values are expressed as days and fractions of a day, of course, and the default date origin is 30 December 1899, so 1 corresponds to midnight at the beginning of 31 December 1899. That is why you are getting "Dec" - nothing to do with December 2016.

Changing it to:
=TEXT(MONTH(NOW())+1,"MMM")
gives me "Jan", which is what I want. Why do I have to add a '1' to it?

You don't, and you shouldn't. Adding 1 gives the result 2, which corresponds to midnight at the start of 1 January 1900, so you will indeed see "Jan", but this is something of a red herring. If you add 2 or 3 or 4 and so on, you will continue to see "Jan"; only when you add 32 and the represented date spills over to 1 February 1900 will you see "Feb".

At 12:12 13/01/2017 -0800, Joe Conner wrote:
Bug?

Really?

At 15:17 13/01/2017 -0500, Charles Marcus wrote:
If it is its been there a long time, because I first encountered this a loooong time ago (I finally decided to ask about it). Would appreciate someone confirming I'm not just crazy, and it should work as I'm expecting.

No, it should not work as you expected - but I have no evidence that you are crazy.

I trust this helps.

Brian Barker


--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.