How to compare the Date Given in Excel Row

Hi Team,
I am working on a project , I need to prepare a logic .

Logic :

  1.    I have a list and list have these value
    

“2:00am, 4:00am, 7:00am, 9:00am, 12:00pm, 2:00pm, 4:00pm,7:00pm,10:00pm”

  1. Now 09:30PM
  2. I want to pick the time which is greater then current time in FIFO mode
  3. Remove that time

Can any one help on the same

@yasir_khalil

Welcome to the community

You can use this

requiredtime = List.Where(function(x) DateTime.ParseExact(x,"hh:mmtt",System.Globalization.CultureInfo.InvariantCulture) > Now)(0)

Cheers

@yasir_khalil

Its parseexact…I gave an extra t

Cheers

Its not reorganizing the list value

@yasir_khalil

Given the format as per 09 if it is only 9 then please use h instead of hh

Cheers

List_Japanese.Where(function(x) DateTime.ParseExact(x,“hh:MMtt”,System.Globalization.CultureInfo.InstalledUICulture) > Now)(0)

This also tried

Thanks Now working

1 Like

@Anil_G : Is this is linq query ?

@yasir_khalil

Yes it is…

I am trying to compare each value with now and then get the first…ideally it would give all times whicha re greater …getting the first using index 0

Cheers

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