Adjusting Timestamp using Expressions
You can use expressions to adjust the timestamp in your labels:
The following is an example of a received time stamp before trying to print it with specialized formatting:
strftime(\~container.received_time_stamp, "%d/%m/%Y %H:%M:%S") if
\~container.received_time_stamp else "-"
Example of offsetting the date by 3 days earlier:
strftime(\~container.received_time_stamp - timedelta(days = 3), "%d/%m/%Y %H:%M:%S") if
\~container.received_time_stamp else "-"
Example of offsetting the time by 3 hours earlier:
strftime(\~container.received_time_stamp - timedelta(hours = 3), "%d/%m/%Y %H:%M:%S") if
\~container.received_time_stamp else "-"
Note: All expressions in document label designer must use “ and not ‘. If you need to
have “ inside of another “ you can put a slash in front of the inner “.
Example:
“get_us_state_name(\"GA\")”
Most of the time this is not needed and there are other ways around it. For instance this could have also been written like the following.
Example:
str( get_us_state_name("GA") )