Select files by date

I need to select the date of some files in excel 48 hours before the end date

Datetime= DateTime.ParseExact(strdate,“dd.MM.yyyy HH:mm”,System.Globalization.CultureInfo.InvariantCulture).AddHours(-48)

Hope this helps you

I don’t get it to work, could you clarify it with an example, Thanks

Convert.TODateTime(“YourData”).AddHours(-48)

error cuando realizo assign
Assign: String was not recognized as a valid DateTime.

Can you please share your string which you are passing?

I have several files with different end dates, I only need those from the last seven days, how can I do the if I had this one
End date> = Now.AddDays (-7) .ToString (“dd / MM / yyyy HH: mm: ss”), but it doesn’t work, could you help me, thanks

Your files date with time too or only date ?

can you please one file name here . If possible share screenshot

fecha finalizacion :02/03/2020 13:23:25

Fecha de finalización real
06/03/2020 10:23:38
04/03/2020 16:08:07
02/03/2020 13:09:45
25/02/2020 12:26:54
of these dates that you select from a web application we only need those that meet the following condition ended in a period less than or equal to 7 days, with respect to today’s date

Saludos

Split the file name wrt to " : "

String.split(":"c)(1) gives you date part

assign to a variable

Put if condition and check whether its Less than or Greater than 7 Days.

I do not understand, please, the dates I need are the last week

I am asking to compare Today’s date with filename date . Find the diff between it and process the flow

Date difference can be found by
DateDifference = DateDiff(DateInterval.Day, Convert.todatetime(“03-10-2020”), Convert.todatetime(“03-22-2020”))

it will give you number of days.

If result is greater than 7 , its old one else its last week record

Also change DateDifference variable to Int64