I have four string columns 'hour', 'day', 'month', 'year'
in my data frame. I would like to create new column fulldate in format 'dd/MM/yyyy HH:mm'
.
df2 = df1.withColumn("fulldate", to_date(concat(col('day'), lit('/'), col('month'), lit('/'), col('year'), lit(' '), col('hour'), lit(':'), lit('0'), lit('0')), 'dd/MM/yyyy HH:mm'))
but it doesn't seem to work. I'm getting format "yyyy-mm-dd".
Am I missing something?