提供了各种时间转换的方法
Project description
将 python 的 requests 代码转换成 curl 命令
安装
pip install time_utils
使用
from time_utils import TimeUtil
print(TimeUtil.get_current_time_str()) ###获取当前字符串格式化时间
print(TimeUtil.get_current_time_unix()) ###获取当前时间戳
print(TimeUtil.get_seven_days_ago_time_unix())
print(TimeUtil.str_time_to_unix("2022-07-07 20:28:50"))
print(TimeUtil.unix_time_to_str(1657197749260))
print(TimeUtil.get_recently_day(-7, 'unix'))
print(TimeUtil.get_day_begin_unix())
print(TimeUtil.get_day_end_unix(-4))
print(TimeUtil.get_month_datetime_begin(datetime.datetime.now()))
print(TimeUtil.get_month_datetime_end(datetime.datetime.now()))
print(TimeUtil.compare_time(datetime.datetime.fromisoformat('2022-07-01 00:00:00'),
datetime.datetime.fromisoformat('2022-05-31 23:59:59')))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
time_util_wj-1.0.3.tar.gz
(2.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file time_util_wj-1.0.3.tar.gz.
File metadata
- Download URL: time_util_wj-1.0.3.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
222dd535a829e750926a4d5ec1162b433bebe5964092d1c74b044375c1e49c1d
|
|
| MD5 |
cdd17a903adea9ffb389a34df0046e6c
|
|
| BLAKE2b-256 |
c865bba8e6db468e99b57cbf4028cf8c1eee6feaa580f9f11513ddc4c35016f1
|
File details
Details for the file time_util_wj-1.0.3-py3-none-any.whl.
File metadata
- Download URL: time_util_wj-1.0.3-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf0924236a2de863748f954964b217d20eb820d8aefdc71dd316f86d203e4068
|
|
| MD5 |
2b1daa189f00cc28e7dfacc226f35862
|
|
| BLAKE2b-256 |
737dc64643361d76940139984320a4a69076e90fe642898942e8f4358a2a4f2e
|