Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Getting long dates
Jason -
If you want to affect the whole database (instance) then you want to redefine: NLS_DATE_FORMAT with the format that you want (MM/DD/YY HH24:MI), (see your DBA to do this)
You can do this at transaction level i.e. in a SQL*Plus session type:
SQL > ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YY HH24:MI'; then any date queried will default to this format.
In SQL queries use the TO_CHAR standard function i.e.
SELECT TO_CHAR(date_column,'MM/DD/YY HH24:MI')
FROM ...
etc.
/
Word of warning though - the millenium is not that far away so you might want to consider using a four digit year by default. . .
Hope this helps. Feel free to reply if this doesn't work out!
These views are my own and not those of my employer. Normal conditions
apply.
nb. anonymous return address used - please replace reply address with those
given above.
Jason C Miller <jm+@andrew.cmu.edu> wrote in article
<AneVunO00YUu0fuUQ0_at_andrew.cmu.edu>...
> I'm trying to get Oracle queries to return long dates format
> (actually, I'm pref'ing to "MM/DD/YY HH24:MI" if possible. Normal
> queries seem to give me just the date. I've tried many combinations
> of "in" and the "to_char" function, but I'm hoping I've missed out on
> a much easier way. Perhaps even a way to make this default for the
> entire database and not just a given query.
>
> I'm using OWS 7.3 and WebServer (WebApp Server if you will) and would
> like to easily be able to query with the long dates. It would be
> extra wonderful if I didn't need to change the included Oracle
> "tablePrint" command to bring up this data (or do some type of view
> select for each table, which is just as ugly IMO).
>
> Thanks in advance,
> Jason
>
>
---Received on Fri Jun 20 1997 - 00:00:00 CDT
> |\\| Jason Miller |//| jm_at_andrew.cmu.edu VOX
412/862-3576
> |//| Information Systems & Comp Sci |\\| jason_at_halotech.com BIZ
412/361-HALO
> |\\| Carnegie Mellon University |//| FAX
412/361-8399
> In the end we will conserve only what we love, we will love only what
we
> understand, we will understand only what we are taught.
>
![]() |
![]() |