提供了各种时间转换的方法
Project description
将 python 的 requests 代码转换成 curl 命令
安装
pip install time_utils
使用
import time_utils
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.2.tar.gz
(2.8 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.2.tar.gz.
File metadata
- Download URL: time_util_wj-1.0.2.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74bf6f9c300cf927deba7f981266fe8d2177bce158165c33259f51c2f3111cbe
|
|
| MD5 |
ed655e4fd90d19e082a1cd4df4c9f598
|
|
| BLAKE2b-256 |
83f74dfc0d066f05ea5f362723bbdfefc53e00bf8e4eee30df70359dd1721093
|
File details
Details for the file time_util_wj-1.0.2-py3-none-any.whl.
File metadata
- Download URL: time_util_wj-1.0.2-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 |
65531ab595a60f4896517739f4be41a58fbf326b6500faa8cf67ee8d847ce93f
|
|
| MD5 |
ff98fff440bdb7e4dc248c3c923dd82a
|
|
| BLAKE2b-256 |
9812482b247928b5d5480bd459ca085d7c8f4829748e8bb56602562603d8b39c
|