How to Save Screenshot along with current datetime?

HI,

I am trying to save screenshot in the following format.
“FileName+CurrentDateTime.png”

But unable to use “DATETIME” DataType and am getting the following error.

" Save image : Save image failed. Check if the file name is a valid path"

please, help me out with it.

Regards,
Faizan.

Hello there,
Because Datetime has space while executing .Hence it’s not valid name.
Try something like this for ex:

“Image”+now.ToString(“dd-MM-yyyy”)+“.png”

2 Likes

@ddpadil Thanks Mate. It worked out fine.

1 Like

HI is there a way to save the screenshot in the same share path and we can differentiate between them other than time and date for example i have a component named ID can i save the screenshot like “Image”+ID.png…Please help