2

Is it possible to print the date in the below format in Informix DB,

May 19 1993 12:00AM ?

Consider the below eg.,

If I shoot the below query,

select sysdate from systables;

It displays as,

2017-12-15 05:00:47.24318

But I want the output to be printed as,

Dec 15 2017 05:00AM
Peter.Fox
  • 41
  • 1
  • 1
  • 5
  • 1
    Cannot you use the [to_date](https://www.ibm.com/support/knowledgecenter/SSGU8G_11.70.0/com.ibm.sqlt.doc/ids_sqt_130.htm) function? – Yann39 Dec 15 '17 at 10:19

1 Answers1

4

References on IBM Informix on-line manuals:
TO_CHAR function here
GL_DATETIME here

select sysdate 
     , to_char(sysdate, '%b %d %Y %R') as _24h
     , to_char(sysdate, '%b %d %Y %I:%M%p') as _12h
from sysmaster:sysdual;


(expression)               _24h                                                _12h                                                
-----------------------------------------------------------------------------------------------------------------------------------
2017-12-15 07:47:04.0      Dec 15 2017 07:47                                   Dec 15 2017 07:47AM                                 
ceinmart
  • 1,759
  • 10
  • 16