How to show date column as string with specific date format (like %d-%m-%Y)

Suppose you have POSIx column in your data frame and you see value as 2016-01-06 19:17:38 in table view and you want to see the data in %d-%m-%Y format. So here is how you can do it.

original column

you can use as.character with format argument like below.

as.character(X4, format = "%d-%m-%Y") like below.

This changes the X4 columns like this in (%d-%m-%Y) format.