Bug 100062 - FORMATTING: dates aren't properly formated (or formated at all) (mind: dates formatted as text)
Summary: FORMATTING: dates aren't properly formated (or formated at all) (mind: dates ...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-26 10:33 UTC by Leonard
Modified: 2016-05-26 12:38 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leonard 2016-05-26 10:33:56 UTC
Hello,


## Meta

Version: 4.3.3.2
Build ID: 430m0(Build:2)
OS: Debian GNU/Linux 8.4 (jessie) 64-bit


## Problem

When one tries to convert a string (eg. "31-12-2016") using "Right click" > "Format Cells" and than selecting a specific date format, either nothing happens or, if the cell was previously formatted as "Text", an apostrophe is happened at the beginning of the string (eg. "'31-12-2016").


## Expected result

The string is converted to the chosen date format.


## How to reproduce the bug

### bug 1: nothing happens

* Open a new Calc document ;
* In the A1 cell, insert "31-12-2016" (DD-MM-YYYY) ;
* "Right click" on this cell, select "Format Cells..." ;
* In the "Numbers" tab, select the "Date" category, select any format, press "Ok".

Note that the problem occurs no matter what the string looks like (DD-MM-YYYY, DD/MM/YYYY, YYYY/MM/DD,...). Except for ISO-8601 (YYYY-MM-DD) strings whose cell is automatically converted to "Date" upon hitting "Enter" or "Tab".

### bug 2: an apostrophe is happened at the the beginning of the string

I can't reproduce this bug in a new document even though I just experienced it in a file I have been working on.

This alternate behavior (insert an apostrophe instead of doing nothing) is not new, see https://ask.libreoffice.org/en/question/6466/trouble-formatting-date-cells-in-calc/
Comment 1 Cor Nouws 2016-05-26 11:36:02 UTC
Hi Leonard,

Thanks for reporting.
This is not a LibreOffice bug per see.
 - There are options how to handle numbers marked as text under Tools > Options > Calc > Formula > Detailed calculation settings... Custom ;
 - On importing from csv one can do a lot;
 - There is an extension that can help in other situations.
http://extensions.libreoffice.org/extension-center/ct2n-convert-text-to-number-and-dates

HTH,
Ciao, Cor
Comment 2 m_a_riosv 2016-05-26 12:38:22 UTC
With the whole cell to convert in the same column, it's possible to use:
Menu/Data/Text to column
Click on the header of the column and select the right Column type for the date.