I have used Get text activity to get a string that in format “dd/MM/yyyy” and write into excel but the day number turn into month number and vice versa. How can i fix it?
And i used Write with DateTime.Now.ToString(“dd/MMM/yyyy”) and it always come with 0:00. How can i fix it?
Thanks you.
Buddy try this conversion while writing in cell buddy @plmtri.kddi
Datetime.Parseexact(out_Create.Substring(9).ToString,“dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd-MMM-yyyy”)
kindly try this and let know whether this works or not buddy
Cheers
Dear @Palaniyappan buddy,
I tried your solution but it giving a error like this.
String was not recognized as a valid DateTime.
I thought that i just want to write exactly as the string on the web site. Can i do that?
buddy may i know at format we are getting from website and with what format you would like to enter buddy
@plmtri.kddi
Dear @Palaniyappan,
The website format is like in the picture, “dd/MM/yyyy”, and i want to write exactly like that but the Get text auto format is “MM/dd/yyyy” so when i write it turn to wrong.
ok no worries try like this buddy @plmtri.kddi
Datetime.Parseexact(out_Create.Substring(0,10).ToString,“MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)
edited buddy @plmtri.kddi
Cheers
Dear @Palaniyappan
This is the picture of the output excel file.
And the solution you gave me, i put it in assign like this?
Right?
@plmtri.kddi
yes buddy is that working
Dear @Palaniyappan buddy,
It work only on the first one and get error like this on the second and third.
Assign: The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar.
Buddy check with format of second and third using a writeline activity once you get the value from get text, i think we need to know the formats of atleast three to four values of date, kindly check that and share the screenshot buddy @plmtri.kddi
we can sort this out, we are almost done
Cheers
This is screenshot for the first one.
This is screenshot for the second one.
This is screenshot for the third one, the one that Get text activity clam that not Datetime format.
Thank you so much buddy @Palaniyappan.
Great buddy
what is the get text value of these, check with a write line activity to display it buddy we need that @plmtri.kddi
then we can easily sort thisout
This is value of Get text Activities.
First one,
Second one,
Third one,
Thank you buddy @Palaniyappan
@plmtri.kddi
buddy we thought we are getting in this MM/dd/yyyy, that is get text is changing theformat, but it didn’t and moreover we were getting that last error because we were mentioning the month first days second and that is not right format for Gregorian,
so use like this buddy
Datetime.Parseexact(out_Create.Substring(0,10).ToString,“dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)
hope you are not taking Create: along with the get text
right buddy @
only the dates
Dear @Palaniyappan,
Yeah i only take the dates buddy,
Thank you very much, i will try this.
Great
try and let know buddy whether it works or not
Cheers @plmtri.kddi
Dear buddy @Palaniyappan,
i don’t know why but it not working
Hi @plmtri.kddi,
Kindly check your system Date format.
What was the error buddy ?
@plmtri.kddi