How to return date from date time?

1.4k views Asked by At

I have OpenOffice Calc column with the following entries:

10/21/12 09:39 AM
12/20/12 05:35 AM
04/30/13 12:47 PM

How do I extract the date part so that output is?:

10/21/12 
12/20/12 
04/30/13 
1

There are 1 answers

0
tohuwawohu On

Just apply ROUNDDOWN() or INT() to the date value to strip the time information; you may have to apply date formatting manually.

The date value 10/21/12 09:39 AM is internally stored as 41203.4020833333 by Calc. Calc uses integers for dates and fractions for time values. So, the date part of 10/21/12 09:39 AM is 41203. Rounding down the value 41203.4020833333 to 41203 effectively strips the time information, leaving just the date (to be precise: the result is 10/21/12 00:00 AM - so it's just a matter of formatting the cell as date or date/time.