Utility Functions and C Language Reference > Utility Functions: C Language (lr_) > Alphabetical Listing > lr_save_datetime

lr_save_datetime

Assigns the current date and time to a parameter.

C Language

void lr_save_datetime( const char *format, int offset, const char *name );
Example: lr_save_datetime String and Parameter Functions

Arguments

Name Comments
format The format of the retrieved date/time information.
offset Offset from the current date and time, using the constants: DATE_NOW, TIME_NOW, ONE_DAY, ONE_HOUR, ONE_MIN. For example, TIME_NOW + ONE_HOUR
name The name of the parameter to store the date/time information.

The lr_save_datetime function saves the current date and time, or the date and time with the specified offset into a parameter. The resulting string will be truncated once it reaches MAX_DATETIME_LEN characters.

The format can be a format defined in an included header file, such as DATE_FM, which is defined in lrun.h. You can use the Datetime Format Codes to build a format with any combination of strings and codes. For example, depending on the definitions in your computer's locale, "The current month is %b" would return The current month is JAN. "%d%b%y" would return 29JAN97.

Return Values

No value is returned.

Parameterization

You cannot use standard parameterization for any arguments in this function.