Convert a data in integer
Posted in 2000
Topics: General Discussion
Hi, How can i convert a date in integer ? Thank you.
Giovanni Guarino wrote: > Hi, > How can i convert a date in integer ? > > Thank you. Is this the conversion of an Integer into date of a date into an integer? To convert a date into an integer you may make use of "interval" say by defining : (4GL) DEFINE date_to_convert DATETIME YEAR TO SECOND DEFINE date_base DATETIME YEAR TO SECOND DEFINE converted_date INTERVAL SECOND TO SECOND LET date_to_convert = CURRENT LET date_base = "01-01-0001 00:00:00" LET converted_date = date_to_convert - date_base This should give you the number of seconds since a set date which is you base in this case "01-01-0001 00:00:00" (dmy4-) To convert back you should add units seconds to your base date. -- Compliments of QueriX -------------------------------------------------------------------------------------------------- QueriX 4GL Compilers are Informix 4GL Compatible, and Connection to other RDBMS such as Oracle. Hydra 4GL Compiler (Compatible with I4GL) Compile once, run everywhere Phoenix Windows GUI. (Front End to 4GL) Chimera Java GUI The only GUI you will ever need... (Front End to 4GL) Arachne Web Technology (Front End to 4GL on the Web & HTML Report Generator) ESQL/C Compiler For more details visit: http://www.querix.com/ ---------------------------------------------------------------------------------------------------