Request: omit time part if time part is zero when exporting grid rows

igitur's profile image igitur posted 9 years ago in General Permalink

One of the most frequently used functions is export to grid rows in Excel CSV format, and then I paste the data into Excel and continue my analysis further.

Most of my datetime columns contain only dates with a zero time part. At the moment, when that part is copied to the clipboard, it is copied as e.g. "2016-01-01 00:00:00.000". When I paste that into Excel, the default formatting that Excel applies is HH:mm:ss, so I see a bunch of zeroes. I have to manually change the format to yyyy-MM-dd to see my date.

An easy fix which will save me many many format changes during to day would be to inspect the date value and if the time part is 00:00:00.000 then just copy the date part to the clipboard, i.e. "2016-01-01". If one pastes that into Excel, Excel autoformats it as HH:mm:ss (or I suppose whatever the locale's date format is).

igitur's profile image igitur posted 9 years ago Permalink

Please, ansgar.

Please login to leave a reply, or register at first.