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
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.