Convert Column date to UK time and add 12,4,6 to date

HI All,

I want to convert column (L, M, N, O, P, Z, AA ) date to UK time (dd/mm/yyyy) and add 12,4,6 to date on column (M ) based on the value in the column (R).
This is CSV file and need to save output also to a CSV file.

Thanks for your support.

@MDias
Parsing a String
YourDateTimeVariable = DateTime.ParseExact(YourDateStringVariable, “dd/MM/yyyy”, new CultureInfo(“en-GB”))

Adding 6 days:
YourDateTimeVariable.AddDays(6)

@ppr
I’m new to UiPath.
Need more detail help and steps so I can follow.
Thanks for your support.

@Mdias. It would be helpfully when you post your questions along with some sample data.

@ppr

I’ve attached CSV file.( I have more than 10000 records in the original file)

1.I need to convert column date ( L,M,N,O,P,Z,AA) to dd/mm/yyyy
2.Then i need to calculate column S (Free Time) based on the value on Column Q ( Carrier)

If Column Q =
APLL add 12 days to ETA (Column L)
APL add 6 days to ETA (Column L)
CMA add 4 days to ETA (Column L)

3.Need to save file as CSV

Hope this gives more information.
Thanks in advance Data.7z (688 Bytes) for helping.

@MDias
PFA Sample CSVDateAddMDias.xaml (7.3 KB)
I did some Kickstarter for you. Remaining tasks you should complete by yourself.
Kindly note: some Date Columns maybe need no conversion or a logic to detect which format is applied.

1 Like

@ppr Thanks i will check and update you

@ppr still it’s not converting as expected.
CSV file saved as mm/dd/yyyy and need to convert to dd/mm/yyyy

image

@MDias Kindly Note:

  • I only preimplemented, you have to complete by yourself
  • Dateformating can be adjusted by changing the format string

Even change same results.
Anyway thanks.

Sorry for adding you but you helped me in the past.
Please help if possible
@paul.placintar

@MDias

To change the date format, use the following logic (you have like 80% of the code already)

read date as string → parse it into a dateTime → write that dateTime using toString(Here specify your new date format )

As an example: you have 05/28/2019 in your csv

12/28/2019 → parse it in a dateTime variable (let’s call it date1) → write in that cell date1.tostring(“dd/MM/yyyy”)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.