Trying to change the date formatting from 21/08/1961 to 1961-08-21 in order to import into our database. However, when reformatting the column accordingly the date format does not appear to change.
Is there a trick or is this a bug?
thanks,
Geoff
Changing Date Format Doesn't work?
Changing Date Format Doesn't work?
OpenOffice3. Mac OSX
Re: Changing Date Format Doesn't work?
You are dealing with text data where "21/08/1961" is just a character sequence of 8 digits and 2 slashes.
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Changing Date Format Doesn't work?
Mmm so how can we convert this to a date. It works perfectly in Excel.
Geoff
Geoff
OpenOffice3. Mac OSX
Re: Changing Date Format Doesn't work?
No, it does not work perfectly well in Excel but that's a different story. Converting wrong data is one thing. I would bother if there are wrong data types in your document and how they got into the sheet. Ctrl+F8 highlights all values.
http://www.yogeshguptaonline.com/2009/1 ... -date.html
http://www.yogeshguptaonline.com/2009/1 ... -date.html
It is easier to do the converion in Calc.Many of us get into a situation when the dates in our data are coded as text. Excel does not recognise such text entries as date and we can not use them for any calculation purpose. However you can easily covert them to date by the help of excel formula.
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Changing Date Format Doesn't work?
Here's one thing you can try:
Select the column with your (text) dates.
Data > Text to Columns
Delimiter: Tab (or any character that does NOT occur in the column)
In the preview grid, select the column (click in the header, marked "Standard") change the type to "Date (DMY)"
OK
Your text dates should now be converted to numeric values and should respond to the cell/number formatting to display whatever format you want.
Alternatively, and this may be preferable to preserve the text data, you can insert a new column and convert the text dates by a formula, something like
=DATE(RIGHT(A1;4);MID(A1;4;2);LEFT(A1;2))
where A1 contains a date as text in the format you showed above.
Using the formula means that the original data are preserved intact.
Select the column with your (text) dates.
Data > Text to Columns
Delimiter: Tab (or any character that does NOT occur in the column)
In the preview grid, select the column (click in the header, marked "Standard") change the type to "Date (DMY)"
OK
Your text dates should now be converted to numeric values and should respond to the cell/number formatting to display whatever format you want.
Alternatively, and this may be preferable to preserve the text data, you can insert a new column and convert the text dates by a formula, something like
=DATE(RIGHT(A1;4);MID(A1;4;2);LEFT(A1;2))
where A1 contains a date as text in the format you showed above.
Using the formula means that the original data are preserved intact.
AOO4/LO5 • Linux • Fedora 23
Re: Changing Date Format Doesn't work?
... which fails if the cells are text formatted.acknak wrote:Data > Text to Columns
... which is the same method as described for Excel in my link http://www.yogeshguptaonline.com/2009/1 ... -date.htmlacknak wrote:=DATE(RIGHT(A1;4);MID(A1;4;2);LEFT(A1;2))
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice