From 83f2bd5d5d0481eff913f51f3648509a3a0a5be4 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Wed, 30 Nov 2022 20:17:20 +0000 Subject: [PATCH] Test datetime. --- __pycache__/mymodule.cpython-39.pyc | Bin 432 -> 415 bytes main.py | 13 ++++++------- mymodule.py | 11 +++++------ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/__pycache__/mymodule.cpython-39.pyc b/__pycache__/mymodule.cpython-39.pyc index daf98337dc5318b5803fadd48078d2c4cc512632..a03234e0b276f10719e0bbf0b5a442c5821ed05f 100644 GIT binary patch literal 415 zcmYjMy-veG47M*x8=>|cSTn%wfDjUhfuT#pQn5twQ7Yw<>T*>TDH}+<28?|L9_3ah zUV#Za1rbaBx4+LW=JO+9x%+r6ckDkU8H?iNinTpvLqJ%8g(V`8qUZ&diegIGM>NSH zn||>WWEfH^yzy&mN-2y*0Iylwl#Pcse1{zNxX4sc?9yFIuGHwW{5etV|xTjN?? zRFBS(zG=#>HMMW`YVCE|kkOSXTz#_X{8Lju*v>Yzt<34B3&~1u5Xx2zpcB?IlK597 zj#-DBW*m6vp~qf5M>#m@X6R%fivo5**(M>3W=3}W$KSdkQQ0&gmzdTn4OeI U%fp)kLV9ty`Vs|1kY<>wA3xzt`~Uy| literal 432 zcmYk1zfQw25XS8|2@xV217ka80Plbh{}eHGK`aqV6uW7p#ExudC_-WYiHATuKp%kj z=$w_e=)|2Xq?~l0&u4$9-<4^4NFcU9pVb?jzj&EO0GDe>djcYepdX|lA}FX}B7`~+ z(Id&?io)}MU>!oggeKG+z`4kn2N>gW09@mn6Dxi;-k)6V_qg)x*iV9x{sEMCRUZHV diff --git a/main.py b/main.py index 7c0204f..f2d4a67 100644 --- a/main.py +++ b/main.py @@ -1,8 +1,7 @@ -#Module test import mymodule as m -from mymodule import foo as bar -m.greeting(m.author) -import platform as plat -print(plat.system()) -print(dir(plat)) -print(bar()) +x = m.gtime() +print(x.year) +print(type(x)) +print(x.strftime("%A")) +y = m.mdate(2022, 11, 30) +print(y) diff --git a/mymodule.py b/mymodule.py index 0395ca6..35654d1 100644 --- a/mymodule.py +++ b/mymodule.py @@ -1,6 +1,5 @@ -def greeting(inpt): - print(f"Hello {inpt}!") -author = "Alfred" -def foo(): - print("Foo Fighters!") - return "Bar" +from datetime import datetime as dt +def gtime(): + return dt.now() +def mdate(y, mo, d): + return dt(y, mo, d)