Formatting dates in PostgreSQL

前端 未结 2 1188
难免孤独
难免孤独 2021-01-15 02:16

I have a field which its format is date with time as: YYYY-MM-DD HH-MM-SS for example: 2000-08-12 00:00:00 I want to get just the date part and cha

相关标签:
2条回答
  • 2021-01-15 02:41

    try with:

    to_char(your_Field, 'dd/mm/yyyy')
    
    0 讨论(0)
  • 2021-01-15 02:51

    You can use the to_char function to format your column:

    SELECT TO_CHAR(ddatte, 'dd/Mon/yyyy') FROM mytable
    
    0 讨论(0)
提交回复
热议问题