Hi all. i have one excel file. in that excel column name is dateandtime. I need time only in that column could you please help me to get that value.
@Buvaneshwaran_R Have you used Read Range Activity to get the Data as Datatable?
If you have done that then you can just check how the value is appearing for the DateTime column in a Message Box, based on that we can Provide you either a Split method or a DateTime.ParseExact() Method
@supermanPunch Thankyou
Of what DateTime format the data is present der in your “dateandtime” column ??
Happy Automation
Best Regards
Er Pratik Wavhal
@Pratik_Wavhal @supermanPunch I tried this method DateTime.ParseExact(row(“Date Entered”).ToString,“MM/dd/yyyy HH:mm:ss tt”,CultureInfo.InvariantCulture).tostring(“HH:mm tt”)
this condition is not working i have attached my excel also can you please check and solve this problem.Book4.xlsx (114.7 KB)
@Buvaneshwaran_R Change the Format to “MM-dd-yyyy HH:mm:ss tt” and check
If the above doesn’t work, change it to “MM-dd-yyyy hh:mm:ss tt” and check
I got the output by using
DateTime.ParseExact(CDate(row("Date Entered")).ToString("MM-dd-yyyy HH:mm:ss tt"),"MM-dd-yyyy HH:mm:ss tt",System.Globalization.CultureInfo.InvariantCulture).ToString("HH:mm:ss tt")
Output :-
-
By using “HH:mm tt”
-
By using “HH:mm:ss tt”
Workflow for the same :-
MainPratik.xaml (11.0 KB)
Mark as solution and like it if this helps you
Happy Automation
Best Regards
Er Pratik Wavhal
@Pratik_Wavhal Thanksyou
If the output is the one you were expecting then Mark it as a solution and like it
Happy Automation
Best Regards
Er Pratik Wavhal
@Pratik_Wavhal i have another doubt also using these values how to get pst time in excel
TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Pacific SA Standard Time");
DateTime newDateTime = TimeZoneInfo.ConvertTime(existingDateTime, timeZoneInfo);
Check the above for the same
Mark as solution and like it if this helps you
Happy Automation
Best Regards
Er Pratik Wavhal
@DateTime.ParseExact(CDate(row(“Date Entered”)).ToString(“MM-dd-yyyy HH:mm:ss tt”),“MM-dd-yyyy HH:mm:ss tt”,System.Globalization.CultureInfo.InvariantCulture).ToString(“HH:mm:ss tt”) get this date how can i convert to pst time? how can you explain it will be really help ful for me
Below statement will give the Output in PST
DateTime.ParseExact(CDate(row("Date Entered")).AddMinutes(-750).ToString("MM-dd-yyyy HH:mm:ss tt"),"MM-dd-yyyy HH:mm:ss tt",System.Globalization.CultureInfo.InvariantCulture).ToString("HH:mm:ss tt")
IST time in Excel (i.e of 1st Row) :-
IST = 7-1-2020 12:26:27 am
Output in PST (i.e for 1st row value) :-
PST = 11:56:27 AM
Converted from Internet the same timing :-
Workflow for the same :-
MainPratik.xaml (14.9 KB)
Book4.xlsx (227.1 KB)
Mark as solution and like it if this helps you
Happy Automation
Best Regards
Er Pratik Wavhal
@Pratik_Wavhal Thank you so much for helpming me.
If the output is the one you were expecting then Mark it as a solution and like it
Happy Automation
Best Regards
Er Pratik Wavhal
@Pratik_Wavhal I don’t have option to mark it as solution.
Actually Till now i haven’t created any post
So i dont know where the option is der to mark it as solution.
But i told u to mark so if anyone searching the solution for same or similar query then it helps to find them the exact solution. So i told you to mark it as solution.
May be the same option to mark it as a solution must be der for u that u have already used in the previous posts you have created and those got solved/ got solution.
Like this u did previously as shown in below thread :-
Let it be. If you find the option then definetly mark it.
Happy Automation
Best Regards
Er Pratik Wavhal