diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-11-29 23:26:18 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-11-29 23:26:18 +0000 |
commit | 1c5aec60bb72ec932d68c71d91147e5516796196 (patch) | |
tree | ead86b20f04796b1f5ace59280dd208fa73114b0 /contrib/dateformat/to-from_char.h | |
parent | 1f747c67222842b93ad833675aca20001a6dd9f8 (diff) |
I finish devel. of Oracle compatible DateTime routines TO_CHAR(),
TO_DATE()
and PgSQL extension FROM_CHAR().
TO_CHAR() routine allow formating text output with a datetime values:
SELECT TO_CHAR('now'::datetime, '"Now is: "HH24:MI:SS');
to_char
----------------
Now is: 21:04:10
FROM_CHAR() routine allow convert text to a datetime:
SELECT FROM_CHAR('September 1999 10:20:30', 'FMMonth YYYY
HH:MI:SS');
from_char
-----------------------------
Wed Sep 01 10:20:30 1999 CEST
TO_DATE() is equal with FROM_CHAR(), but output a Date only:
SELECT TO_DATE('September 1999 10:20:30', 'FMMonth YYYY
HH:MI:SS');
to_date
----------
09-01-1999
In attache is compressed dir for the contrib. All is prepared, but I'am
not
sure if Makefile is good (probably yes).
Comments & suggestions ?
Thomas, thank you for your good advices.
Karel
------------------------------------------------------------------------------
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/
Diffstat (limited to 'contrib/dateformat/to-from_char.h')
-rw-r--r-- | contrib/dateformat/to-from_char.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/dateformat/to-from_char.h b/contrib/dateformat/to-from_char.h new file mode 100644 index 00000000000..e96e0a3797e --- /dev/null +++ b/contrib/dateformat/to-from_char.h @@ -0,0 +1,18 @@ + +#ifndef TO_FROM_CHAR_H +#define TO_FROM_CHAR_H + +/*------ + * For postgres + *------ + */ +extern text *to_char(DateTime *dt, text *format); +extern DateTime *from_char(text *date_str, text *format); +extern DateADT to_date(text *date_str, text *format); + +extern text *ordinal(int4 num, text *type); + +extern char *months_full[]; /* full months name */ +extern char *rm_months[]; /* roman numeral of months */ + +#endif
\ No newline at end of file |