Forum OpenACS Q&A: date formats in bboard package

Collapse
Posted by Jose Carrion on
I'm trying to change the date formats for posts in the Bbaord package and I'm stuck. You would think it enough to change

to_char(sent_date,'Month DD, YYYY HH:Mi am') as pretty_date

to

to_char(sent_date,'DD/MM/YYYY HH:MI am') as pretty_date

in /packages/bboard/www/message.tcl, but nothing happens, the output still reads something like "June 10, 2003 07:58 pm". When I write (in e.g. message.tcl)

db_1row current_date { select to_char(now(),'DD/MM/YYYY HH:MI am') as date_now }

and then write "@date_now@" in the .adp, I get what I want ( i.e., "11/06/2003 08:56 pm"). What am I doing wrong? I've been searching the board for a long while but I can't seem to fix this.

Collapse
Posted by Cathy Sarisky on
Are you making the change in the sql text in message.tcl itself, or in message-postgresql.xql?  If not in message-postgresql.xql, check there to see if the code that's actually being used is hiding THERE instead of in message.tcl.  (Most db-specific code is in an .xql file, not in the .tcl file.)

Hope that helps.

Collapse
Posted by Jose Carrion on
It certainly sounded like a promising suggestion. After making the same change in message-postgresql.xql I'm still getting "June 11, 2003 11:46 pm", though. Rrrr...

Thanks for the info about database code location, though. I had overlooked this completely.

Collapse
Posted by Tilmann Singer on
You also need to go to the apm (/acs-admin/apm/) and watch that file to make the change become effective without server restart.

I just wanted to refer you to the docs here: https://openacs.org/doc/openacs-4-6-3/db-api.html - but it seems they don't contain anything about xql files, oops. Anybody knows if/where this stuff is documented? Maybe someone could at least add a comment at the bottom of that doc.

Collapse
Posted by Jose Carrion on
That did it!  Actually, Ijust restarted the server and everything turned out.  Thank you both so very much for your help.