decorative banner

Previous | Next               Table Of Contents > 8 Working with timestamps > 8.2 Using timestamps

8.2 Using timestamps


Timestamps or portions of timestamps are frequently added to file names. The following examples show how time stamps can be appended to files and how file names can be searched for specific timestamps.

gettimestamp ~my_timestamp; # generate current timestamp

foreach $local_item in @local_list begin
strprint ~new_name, ~my_timestamp, "_", $item.name; #prepend timestamp to file name
end



gettimestamp ~my_timestamp, decr, day, 1; #generate timestamp that is a day old

foreach $local_item in @local_list begin
strprint ~search_name, "*", ~my_timestamp, "*"; #generate search string
if ~search_name eq $local_item.name begin
#search for files with this timestamp as part of their filename
end
end


Previous | Next