StringReplace?

eNarc
eNarc used Ask the Experts™
on
DateTimeToStr(Now)

StringReplace(DateTimeToStr(Now), ['/',':'], ['.',['.'],[rfReplaceAll, rfIgnoreCase]);


how do I get something like this to work? changing 2 things within 1 stringreplace.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ephraim WangoyaSoftware Engineer

Commented:
Use this
StringReplace(StringReplace(DateTimeToStr(Now), '/', '.',[rfReplaceAll, rfIgnoreCase]), ':', '.', [rfReplaceAll, rfIgnoreCase]))

Open in new window

Commented:
ewangoya's approach is ok, but just to correct it and make it work:
 
The last closing bracket is wrong and you have to leave it off!!!

StringReplace( StringReplace(DateTimeToStr(Now), '/', '.',[rfReplaceAll, rfIgnoreCase]) , ':', '.', [rfReplaceAll, rfIgnoreCase])
Top Expert 2014
Commented:
or you could just format the datetime value with the FormatDateTime() function.

FormatDateTime('mm.dd.yyyy hh.nn.ss', Now)

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial