Change Date Format in text field

Hi, i have one excel file get data and type into web text field. in excel date is dd/mm/yyyy but type in to text field dd/mm/yyyy ss:mm:hh how to solve this is pls any one solve this issue.
Screenshot 2024-04-18 143524

@MD_Farhan1 You have used for loop right? to iterate each row and fill data into website and you need to right only date not with the hrs and mins.

Regards,
Ajay Mishra

Right but my source excel file don’t have time details.

Use this wherever you are typing date

Convert.ToDateTime(currentrow(“Date”).ToString).ToString(“dd/MM/yyyy”)

let me know if this helps

1 Like

@MD_Farhan1 Yes, It is a date that’s why bot is converting it into DateTime,

DateTime.ParseExact(str_InputDate.ToString,"MM/dd/yyyy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")

Note: Replace str_InputDate with your variable.

Pass above query in TypeInto activity!

Regards,
Ajay Mishra

pls tell me elaborate . i am using read workbook to store table . the set text using currentRow(“Join Date”).ToString
how to update

Use this:

DateTime.ParseExact(currentRow("Join Date").ToString,"MM/dd/yyyy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")

OR

DateTime.ParseExact(currentRow("Join Date").ToString,{"MM/dd/yyyy HH:mm:ss","dd/MM/yyyy"},System.Globalization.CultureInfo.InvariantCulture,DateTimeStyles.None).ToString("dd/MM/yyyy")

In TypeInto.

Regards,
Ajay Mishra

1 Like

Thank you Bro. now its working fine

your output also working fine

i need another one help to select drop down from excel value is developer but in web drop down developer (Department _name)
Screenshot 2024-04-18 153047
Screenshot 2024-04-18 153034

Hey @MD_Farhan1 ,

I’ll help you in this,
Please post this question in another loop, cause this can create confusion to others!

Regards,
Ajay Mishra

k bro pls check this link

hi Bro i have number of columns issue is birth date . i am using type into activity currentRow.(“Birth Date”).ToString. its work some row some row is wrong. what i do. your solution also not suitable

@MD_Farhan1 Just debug it where the error occurs go to the immediate panel and put currentRow(“Birth Date”).ToString send me the screenshot!

Regards,
Ajay Mishra

See first row print only date but second row print date and time but both are same format.
Screenshot 2024-04-18 171131

Screenshot 2024-04-18 171326

@MD_Farhan1 I told you to pass my query in type into why you have passed only "currentRow("Birth Date").ToString"

Regards,
Ajay Mishra

Below Error is occure on your Query.


Above error is occurs.
What I am saying currentrow(“Birth Date”).To string work some row some row not working.

Hi @MD_Farhan1

Try the below query:

DateTime.ParseExact(CurrentRow("Birth Date").ToString,{"MM/dd/yyyy HH:mm:ss","dd/MM/yyyy"}, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None).ToString("dd/MM/yyyy")

Regards

1 Like

@MD_Farhan1 I have edited try that!

Regards,
Ajay Mishra

Thanks Bro. its Working.

1 Like