Forum OpenACS Q&A: Response to formatting timestamps

Collapse
Posted by Don Baccus on
Hmmm ... presumably dt_ansi_to_pretty is supposed to replace util_AnsiDatetoPrettyDate but isn't doing the truncation of the timestamp that's necessary to make it work.

AnsiDatetoPrettyDate is meant to only return the date portion.  The best way to format timestamps in both Oracle and PostgreSQL is to use the "to_char" function.  The PG version's a subset of the Oracle version but the functionality's complete enough for most needs.  "to_char()" takes a format string that gives you complete control over how the format of the resulting string.