I want to convert Julian date to Calendar date in UiPath, specially through assign activity.
Anyone knows how to convert it?
For e.g. I have Julian date : 118072 and it’s calendar value is 13-03-2011 00:00.
Any help would be appreciated.
Hi THIRU_NANI, could you please elaborate more? I’m not getting it, its just Class, but how to use it? an explanation through example would be great help.
Hope the below steps would help you resolve this
Say you have your input in a string variable named Strinput
Now use a assign activity like this
int_date = 2000+Convert.ToInt33(Strinput.Substring(1,2))
Int_date is of type int32
- One more assign activity
int_year = Convert.ToInt32(Strinput.Substring(4))
- Then final assign activity like this
stroutput = Datetime(int_year,1,1).AddDays(int_date-1).ToString(“dd-MM-yyyy hh:mm”)
I’m trying your solution. But it’s saying “ToInt33 not a member of system.convert”? even though int_date is set to int32. How to resolve this?
Oh sorry that’s a typo
Yeh, and one more typo, int_days should be int_date right?
and I have made variable strouput as System.DateTime. But I’m getting error : ‘Datetime’ is type and can’t be used an expression. For the last assign activity.
That’s right my bad
Where stroutput is variable of type string
Hi, I’m using stroutput as a ‘string’ but the same error. Could you please advise?
Not able to find AddDays in expression.
In case if you have zip file of working code, please share.
Aah got it
We need to add New before Datetime like this
stroutput = New Datetime(int_year,1,1).AddDays(int_date-1).ToString(“dd-MM-yyyy hh:mm”)
Stroutput is string variable
Hi, I tried this, now it’s not showing any error, but it’s giving wrong output.(wrong calendar date)
I have attached the zip file of the code for your reference.
I have taken julian date as "118072 " and it’s calendar date it coming as “10-07-0077 12:00”.
JuliantoCalendar.zip (2.2 KB)
You able to debug my code?
Given approach giving wrong result.
@Parth_Doshi @Pablito @loginerror
If you have any idea, please assist.
Dear @Palaniyappan ,
I have similar issue and tried the output as mentioned above in the above conversation.
I have the dates in the excel column as show in screen shot below. When I check the format it is in custom and in en-US format.
When I read range then the date get converted to a number.
Ex: 24-Jan-2022 equivalent number in data table is 44585
This is the output that I received
Appreciate your feedback as always.
looks more like an OADate