I am trying to load a data set in R which has USERID and Date. I am trying to pull the MIN(DATE) for the userID using sqldf but seem to have a problem with the result. 

I converted the date column using posixct and checked the typeof column and it showed double(it was integer before the conversion) 

```
test$C_DATE <- as.POSIXct(test$C_DATE, format = c("%m-%d-%Y %H:%M"))
minDate <- sqldf("SELECT U_ID,MIN(C_DATE) AS FTrans FROM test WHERE U_ID = 'ABC' GROUP BY U_ID")

```

The expected Output should be

```
U_ID FTrans
ABC  12/20/2017  5:00:47 PM

```

But i get 

```
U_ID FTrans
ABC  1507631400

```

I tried to use the incorportate the date function in SQL as the below query 

```
minDate <- sqldf("SELECT U_ID,DATE(MIN(C_DATE),'unixepoch','localtime') AS FTrans FROM test WHERE U_ID = 'ABC' GROUP BY U_ID")

```

But I get the wrong date and also the wrong format as a result.

```
U_ID FTrans
ABC  2017-10-10

```

SAMPLE DATA

```
UID    C_DATE
ABC    10/11/15 9:05
ABC    10/11/15 20:08
DEF    10/11/15 11:37
GHI    10/11/15 20:08
JKL    10/11/15 2:46

```

Ideally for User ABC I want the first recorded data(MIN DATE) i.e. 10/11/15 9:05

Any help would be appreciated. Thanks.