[SOLVED] Date format


#1

I need a date in this format " DD/MM/YYY "( not using native query).
Now date in string format “Friday, January 26, 2018 7:38 AM” So I couldn’t sort properly.

Can you help me?


#2

Hi, @lechu,

Build the question in builder and convert to sql then append

Date_format(@date, “%d/%m/%Y”)


#3

The next version of Metabase, 0.31, will also include lots of new options for formatting dates, numbers, and currencies without having to use SQL.


What will be new in Metabase 0.31?
#4

Yay :slight_smile:


#5

Double yay :slightly_smiling_face: :slightly_smiling_face:


#6

When is the next version releasing?


#7

Hi Siddarth

I am not sure what you mean by ‘then append’.

I have the same date issue. The date field is simply labelled ‘date’.

Would I therefore write ‘Date_format(date, “%d/%m/%Y”)’ in the select function, or do I put the decorated statement ‘Date_format(@date, “%d/%m/%Y”)’ somewhere else?

I have tried both, but with no luck.

Thanks! Andrew


#8

Hey Andrew,

Which Sql are you using.


#9

Postgress


#10

Could you try with this syntax

SELECT TO_CHAR(NOW() :: DATE, ‘dd/mm/yyyy’);

The one i mentioned earlier was for Mysql.


#11

Thank you!