Download Latest Version tpc-c-ifmx.tar.gz (392.7 kB)
Email in envelope

Get an email when there's a new version of IIUG Software Repository

Home / StoredProcedures / unixtimespl
Name Modified Size InfoDownloads / Week
Parent folder
frunixtime.spl 2020-05-11 1.8 kB
tounixtime.spl 2020-05-11 2.6 kB
unixtime_README 2020-05-11 1.1 kB
Totals: 3 Items   5.5 kB 0
This is a FAQ.  There are answers available from http://groups.google.com/;
the code should be available at the IIUG web site.   ...well...I thought
there was...  The inverse function, to_unix_time() certainly is out there!

OK; here's a brand new stored procedure, FROM_UNIX_TIME(), that takes a
DECIMAL value (to allow for fractional seconds; if you pass an integer, it
will be converted automatically) and spits out a DATETIME YEAR TO
FRACTION(5).  And there's an upgraded TO_UNIX_TIME() that also handles
fractional seconds.


Sam Gentsch wrote:

> Is there a function in SQL to change a integer which is
> actually an Epoch or UNIX time to a human readable date?
> (I have searched documentation and the web with no luck)
>
> The design was before my time, not sure why they chose
> not to let Informix handle the date.
>
> If it matters, IDS 7.30 on Solaris 7 or 9.30 on Solaris 8.
>
> Sam Gentsch


-- 
Jonathan Leffler (jleffler@us.ibm.com)
STSM, Informix Database Engineering, IBM Data Management Solutions
4100 Bohannon Drive, Menlo Park, CA 94025
      "I don't suffer from insanity; I enjoy every minute of it!"
Source: unixtime_README, updated 2020-05-11