lr_save_timestamp

Saves the current time in a parameter.

int lr_save_timestamp( const char* tmstampParam, [DIGITS,] LAST );
Alphabetical Listing - C Language Utility Functions

Arguments

NameComments
tmstampParamThe name of the parameter to store the timestamp.
DIGITS

Optional. The number of digits for the timestamp (integer). The default is 13. With DIGITS=13, the resolution is epoch time including milliseconds. The milliseconds are the last three digits.
With DIGITS=10, the resolution is in seconds.

If the value of DIGITS is less than 1 or more than 16, the default is used

lr_save_timestamp saves the current local timestamp of the computer running the script.

The timestamp cannot be stored as an integer or long integer.

Return Values

Returns LR_PASS (0) on success. Non-zero return value indicates failure.

Parameterization

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

Example

In this example, the timestamp is saved with the default length of 13 characters - the epoch time plus milliseconds.

   lr_save_timestamp("param", LAST );
   lr_output_message(lr_eval_string("{param}"));

      Action.c(6): 1442490056250

In this example, the timestamp is saved and a length of 10 digits is specified - the epoch time in seconds.

   lr_save_timestamp("param", "DIGITS=10", LAST );
   lr_output_message(lr_eval_string("{param}"));

      Action.c(9): 1442490056

In this example, the timestamp is saved and a length of 16 digits is specified - the epoch time plus microseconds.

   lr_save_timestamp("param", "DIGITS=16", LAST );
   lr_output_message(lr_eval_string("{param}"));
			

      Action.c(14): 1442490600155749