Jump to content

[SOLVED] date format


suyesh.amatya

Recommended Posts

SELECT *,extract(year from date_of_post)as year from table

 

The format is EXTRACT(date_type FROM date_column) where date_type is the component to retrieve and date_column is the name of the column from which to extract data

 

This query gives the desired result,without the overhead of string manipulation after fetching from the database.

Link to comment
https://forums.phpfreaks.com/topic/118570-solved-date-format/#findComment-610448
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.