{"id":1903,"date":"2024-08-04T13:40:44","date_gmt":"2024-08-04T12:40:44","guid":{"rendered":"https:\/\/blog.univ-angers.fr\/mathsinfo\/?p=1903"},"modified":"2024-08-04T14:21:12","modified_gmt":"2024-08-04T13:21:12","slug":"representation-du-temps-calculs-sur-les-dates-et-heures","status":"publish","type":"post","link":"https:\/\/blog.univ-angers.fr\/mathsinfo\/2024\/08\/04\/representation-du-temps-calculs-sur-les-dates-et-heures\/","title":{"rendered":"Repr\u00e9sentation du temps &#8211; Calculs sur les dates et heures"},"content":{"rendered":"\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Repr\u00e9sentation du temps - Calculs sur les dates et heures\" width=\"584\" height=\"329\" src=\"https:\/\/www.youtube.com\/embed\/KK5JoFpnnWU?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Pourquoi 60 ?<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\n\ndef nb_diviseurs(n):\n    count = 0\n    for i in range(1, int(math.sqrt(n)) + 1):\n        if n % i == 0:\n            if n == i * i: count += 1\n            else: count += 2\n    return count\n\nmaxi = 0\nfor n in range(1, 100):\n    t = nb_diviseurs(n)\n    if t &gt; maxi:\n        print(f\"{n} a {t} diviseurs\")\n        maxi = t\n\n# R\u00e9sultats :\n\n1 a 1 diviseur\n2 a 2 diviseurs\n4 a 3 diviseurs\n6 a 4 diviseurs\n12 a 6 diviseurs\n24 a 8 diviseurs\n36 a 9 diviseurs\n48 a 10 diviseurs\n60 a 12 diviseurs\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Nombre de jours entre 2 dates<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>mois_jours = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)\n\ndef est_bissextile(annee):\n    return (annee % 4 == 0 and annee % 100 != 0) or annee % 400 == 0\n\ndef jours_dans_annee(jour, mois, annee):\n    jours = jour\n    for m in range(1, mois):\n        jours += mois_jours&#091;m - 1]\n    if mois &gt; 2 and est_bissextile(annee): jours += 1\n    return jours\n\ndef jours_entre_dates(j1, m1, a1, j2, m2, a2):\n    if (a1, m1, j1) &gt; (a2, m2, j2):\n        j1, m1, a1, j2, m2, a2 = j2, m2, a2, j1, m1, a1\n    jours_total = 0\n    if a1 == a2:\n        return jours_dans_annee(j2, m2, a2) - jours_dans_annee(j1, m1, a1)  \n    jours_total += (366 if est_bissextile(a1) else 365) - jours_dans_annee(j1, m1, a1)\n    jours_total += jours_dans_annee(j2, m2, a2)  \n    for annee in range(a1 + 1, a2):\n        jours_total += 366 if est_bissextile(annee) else 365  \n    return jours_total\n\n# Exemple\n\n&gt;&gt;&gt; jours_entre_dates(15,10,1582,4,8,2024)\n161366<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Programme CULMINATION pour les ti-82\/83\/84<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Disp \"JJMM.AA ?\"\nInput D\nDisp \"LONGITUDE ?\"\nInput L\ndbd(101+fPart(D),D\u2192N\n2\u03c0(N-81)\/365\u2192B\n7.678sin(B+1.374)-9.87sin(2B)\u2192E\nDisp \"CULMINATION\"\n12+E\/60-L\/15\u25b8DMS<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/08\/Capturer1-1722777551725.png\"><img loading=\"lazy\" decoding=\"async\" width=\"324\" height=\"244\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/08\/Capturer1-1722777551725.png\" alt=\"\" class=\"wp-image-1907\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/08\/Capturer1-1722777551725.png 324w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/08\/Capturer1-1722777551725-300x226.png 300w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><\/a><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\">Programme LONGITUDE pour les ti-82\/83\/84<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Disp \"CULMINATION\"\nDisp \"HH\u00b0MM'SS''?\"\nInput H\ngetDate\u2192L\u2081\n100L\u2081(3)+L\u2081(2)+remainder(L\u2081(1),100)\/100\u2192D\ndbd(101+fPart(D),D\u2192N\n2\u03c0(N-81)\/365\u2192B\n7.678sin(B+1.374)-9.87sin(2B)\u2192E\nDisp \"LONGITUDE :\"\n15*(12+E\/60-H)<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/08\/Capturer1-1722777641368.png\"><img loading=\"lazy\" decoding=\"async\" width=\"324\" height=\"244\" src=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/08\/Capturer1-1722777641368.png\" alt=\"\" class=\"wp-image-1908\" srcset=\"https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/08\/Capturer1-1722777641368.png 324w, https:\/\/blog.univ-angers.fr\/mathsinfo\/files\/2024\/08\/Capturer1-1722777641368-300x226.png 300w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><\/a><figcaption class=\"wp-element-caption\">Longitude trouv\u00e9e pour le 2 ao\u00fbt 2024<\/figcaption><\/figure>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Pourquoi 60 ? Nombre de jours entre 2 dates Programme CULMINATION pour les ti-82\/83\/84 Programme LONGITUDE pour les ti-82\/83\/84<\/p>\n","protected":false},"author":4913,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1903","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"_links":{"self":[{"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/posts\/1903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/users\/4913"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/comments?post=1903"}],"version-history":[{"count":4,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/posts\/1903\/revisions"}],"predecessor-version":[{"id":1909,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/posts\/1903\/revisions\/1909"}],"wp:attachment":[{"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/media?parent=1903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/categories?post=1903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.univ-angers.fr\/mathsinfo\/wp-json\/wp\/v2\/tags?post=1903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}