Python တွင် struct_time မှ epoch format ရယူခြင်း
object
struct_time မှ စက္ကန့်များ epoch ကို ပြန်လည်ရရှိရန်
time module ၏ method
mktime ကို အသုံးပြုနိုင်သည်။
ယခု
gmtime method ကို အသုံးပြု၍
struct_time object တစ်ခု ရယူကြပါစို့:
now = time.time()
st_time = time.gmtime(now)
ထို့နောက်
struct_time ကို
mktime method ဖြင့် ပြောင်းလဲပါမည်:
res = time.mktime(st_time)
print(res) # စက္ကန့်အရေအတွက်ကို ထုတ်ပြမည်