https://dev.kronoz.win/r/marzneshin.git
| 1 |
a47eb4c |
Dawsh |
2y ago |
from datetime import datetime as dt |
| 2 |
a47eb4c |
Dawsh |
2y ago |
|
| 3 |
a47eb4c |
Dawsh |
2y ago |
|
| 4 |
a47eb4c |
Dawsh |
2y ago |
def calculate_usage_percent(used_traffic: int, data_limit: int) -> float: |
| 5 |
a47eb4c |
Dawsh |
2y ago |
return (used_traffic * 100) / data_limit |
| 6 |
a47eb4c |
Dawsh |
2y ago |
|
| 7 |
a47eb4c |
Dawsh |
2y ago |
|
| 8 |
a47eb4c |
Dawsh |
2y ago |
def calculate_expiration_days(expire: int) -> int: |
| 9 |
a47eb4c |
Dawsh |
2y ago |
return (dt.fromtimestamp(expire) - dt.utcnow()).days |