Retts()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Return a datetime string

SYNONYM

api_ret_ts()

SYNOPSIS

#include "lianja_api.h"
 
int	_retts(string)
 
<input parameters>
char	*string;		/* Address of a buffer containing a character string	*/
 
<output parameters>
none

DESCRIPTION

The _retts() function returns a character string in the format "YYYYMMDDHHMMSS" as a datetime type. The DATE_TTOS() function can be used to convert a datetime stored in a DATETIME structure to a string format.

EXAMPLE

The following example evaluates the first parameter passed to a string and then returns the result.

Example Lianja script:

m_datetime=datetime()
m_datetime=datetime_con(m_datetime)
return

Example 'C' function:

#include "lianja_api.h"
 
lianjaapi_datetime_con()
{
    char	datetime[15];
 
    if ( _parinfo(1) == API_TTYPE ) {
       strcpy( datetime, _parts(1));
    } else {
       strcpy( datetime, "");
    }
 
    _retts (datetime );
}

SEE ALSO

_parc(), _parclen(), _parcsiz(), _parinfo(), _retc(), _retclen(), ISDATETIME(), DATE_STOT(), DATE_TTOS()