Jun 22, 2006 #1 plork123 Programmer Mar 8, 2004 121 GB hi all can someone tell me how i format a datetime field so it's like this 'Thurday 22 June 2006' many thanks
hi all can someone tell me how i format a datetime field so it's like this 'Thurday 22 June 2006' many thanks
Jun 22, 2006 #2 feherke Programmer Aug 5, 2002 9,540 RO Hi Code: select to_char(now(),'Day DD Month YYYY'); http://www.postgresql.org/docs/7.3/interactive/functions-formatting.html Feherke. http://rootshell.be/~feherke/ Upvote 0 Downvote
Hi Code: select to_char(now(),'Day DD Month YYYY'); http://www.postgresql.org/docs/7.3/interactive/functions-formatting.html Feherke. http://rootshell.be/~feherke/
Jun 22, 2006 Thread starter #3 plork123 Programmer Mar 8, 2004 121 GB thanks - why do i get a massive gap between the month and year? "Thursday 22 June 2006 Upvote 0 Downvote
Jun 22, 2006 #4 feherke Programmer Aug 5, 2002 9,540 RO Hi Because [tt]Month[/tt] is padded. Suppress the extra spaces. Code: select to_char(now(),'Day DD [red]FM[/red]Month YYYY'); Feherke. http://rootshell.be/~feherke/ Upvote 0 Downvote
Hi Because [tt]Month[/tt] is padded. Suppress the extra spaces. Code: select to_char(now(),'Day DD [red]FM[/red]Month YYYY'); Feherke. http://rootshell.be/~feherke/
Jun 22, 2006 Thread starter #5 plork123 Programmer Mar 8, 2004 121 GB i'll do it like this, but would be interested to know why there's a gap SELECT TO_CHAR(now(), 'Day') || ' ' || DATE_PART('DAY', now()) || ' ' || RTRIM(TO_CHAR(now(), 'Month'))|| ' ' || DATE_PART('YEAR', now()) AS date Upvote 0 Downvote
i'll do it like this, but would be interested to know why there's a gap SELECT TO_CHAR(now(), 'Day') || ' ' || DATE_PART('DAY', now()) || ' ' || RTRIM(TO_CHAR(now(), 'Month'))|| ' ' || DATE_PART('YEAR', now()) AS date