Replace characters in timestamp for acceptable filenames

The codes below will translate a timestamp so it can be used in a Windows filename. Removing characters such as spaces, colons, and dashs ( :/). A LotusScript version has also been added below.
Lotus Formula • LotusScript

FORMULA VERSION 1

@ReplaceSubstring( @Text(@Now) ; " " : ":" : "/" ;"_")

input
06/04/2004 11:09:54 AM

output
06_04_2004_11_09_54_AM

FORMULA VERSION 2

@ReplaceSubstring( @ReplaceSubstring( @Text(@Now) ;"/" ;"-") ;" " : ":" ;"_")

input
06/04/2004 11:32:25 AM

output
06-04-2004_11_32_25_AM

LOTUSSCRIPT VERSION

Dim timestampstring As Variant
timestampstring = Evaluate(|@ReplaceSubstring( @ReplaceSubstring( @Text(@Now) ;"/" ;"-") ;" " : ":" ;"_")|)
	
localpathandfile = "C:\Temp\" & timestampstring(0) & "_" & outputfile

Posted by fbrefere001 on Friday June 4, 2004