import datetime,math exact = datetime.datetime.now() newsecs = math.floor(exact.second/30.0)*30.0 newtime = exact.replace(second=newsecs,microsecond=0) print exact,newtime
2011-08-17 21:37:46.296000 2011-08-17 21:37:30 2011-08-17 21:37:56.562000 2011-08-17 21:37:30 2011-08-17 21:38:02.171000 2011-08-17 21:38:00 2011-08-17 21:39:35.484000 2011-08-17 21:39:30
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.