Date format from Excel into PDF

Hi,

I am trying to read a date from an excel file e.g (01/01/2018) and type it into a pdf form. But when it types into the pdf form, it types 01/01/2018 00:00:00. How do I get rid of the 00:00:00?

Right now I just have a variable for a cell in excel with the date next to it.

Hi @richleeb2

Try this cellValue.ToShortDateString()

Thanks for the response. However, i dont want to type in the actual date because it is a variable so I anticipate data changes in the excel file. Initially I tried datevariable.tostring(“mm/dd/yyyy”) but it just types into the pdf form mm/dd/yyyy.

I don’t understand, do you read the date from the cell in excel sheet and then you write it?
Or is it something else?

Yes, the bot reads the cell from excel and then types it into pdf form.

If you have a variable (I suppose it is datevariable) then you simply need to format it, using tostring as you mentioned or toshortdatestring

@reda means the same thing. He wants you to do datevariable.ToShortDateString