date format in postgresql database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • somaskarthic
    New Member
    • Aug 2006
    • 60

    date format in postgresql database

    Hi

    In postgresql database how to retrieve the date in a required format ? Is ther any method
    to retrieve the stored date value in mm/dd/yyyy format. I don't want to set the date format in postgres databse . Whatever format the date value stored , is there any method to retrieve the date in any required format ?
    Pls post your replies

    Thank n advance
    somas
  • masdi2t
    New Member
    • Jul 2006
    • 37

    #2
    Originally posted by somaskarthic
    Hi

    In postgresql database how to retrieve the date in a required format ? Is ther any method
    to retrieve the stored date value in mm/dd/yyyy format. I don't want to set the date format in postgres databse . Whatever format the date value stored , is there any method to retrieve the date in any required format ?
    Pls post your replies

    Thank n advance
    somas
    please refer to to_char function documentation.
    here is a little sample for u:
    Code:
    SELECT to_char(current_date, 'dd/mm/yyyy')

    Comment

    Working...