LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Round Date/Time to closest minute

Solved!
Go to solution

Hello,

 

Is there a simple way to round a date/time to the nearest Minute ?

 

Example :  22/03/2013 10:23:35 rounded to 22/03/2013 10:24:00

                 22/03/2013 10:23:29 rounded to 22/03/2013 10:23:00

 

I could juste compare the seconds to 30 and round to Minute or Minute+1 but I would have to manage the change of day/month/year

 

Thanks,

 

User

0 Kudos
Message 1 of 3
(3,208 Views)
Solution
Accepted by topic author User79

@User79 wrote:

Hello,

 

Is there a simple way to round a date/time to the nearest Minute ?

 

Example :  22/03/2013 10:23:35 rounded to 22/03/2013 10:24:00

                 22/03/2013 10:23:29 rounded to 22/03/2013 10:23:00

 

I could juste compare the seconds to 30 and round to Minute or Minute+1 but I would have to manage the change of day/month/year

 

Thanks,

 

User


Here is a way to do it.

 

round to nearest minute.png

 

Ben64

Message 2 of 3
(3,198 Views)

Hi Ben64,

 

Sorry for the delay. thanks for the accurate and quick answer !

 

Regards,

 

User

0 Kudos
Message 3 of 3
(3,101 Views)