Time utils for Humans.
Project description
Requests: Python utils - Time
=========================
Get demand time from all kinds of original time format after delay without specified type.
Usage
---------------
def get_time(ts=None, delay=0, fmt=19)
Arguments: [original_time] [delay] [output_fmt:{0,6,8,10,16,17,19}]
output_fmt:
19: '%Y-%m-%d %H:%M:%S',
8: '%Y%m%d',
6: '%Y%m',
10: '%Y-%m-%d',
16: '%Y-%m-%d %H:%M',
17: '%Y%m%d-%H:%M:%S'
Input format(Any one of them)
------------
# 201809
# 20180910
# 2018-09-10
# 2018-09-10 18:00
# 20180910-18:00:00
# 2018-09-10 18:00:00
# 1536573600(int)
# 1536573600.00(float)
Return format(Any one of them)
-------------
# 201809
# 20180910
# 2018-09-10
# 2018-09-10 18:00
# 20180910-18:00:00
# 2018-09-10 18:00:00
# 1536573600(int)
=========================
Get demand time from all kinds of original time format after delay without specified type.
Usage
---------------
def get_time(ts=None, delay=0, fmt=19)
Arguments: [original_time] [delay] [output_fmt:{0,6,8,10,16,17,19}]
output_fmt:
19: '%Y-%m-%d %H:%M:%S',
8: '%Y%m%d',
6: '%Y%m',
10: '%Y-%m-%d',
16: '%Y-%m-%d %H:%M',
17: '%Y%m%d-%H:%M:%S'
Input format(Any one of them)
------------
# 201809
# 20180910
# 2018-09-10
# 2018-09-10 18:00
# 20180910-18:00:00
# 2018-09-10 18:00:00
# 1536573600(int)
# 1536573600.00(float)
Return format(Any one of them)
-------------
# 201809
# 20180910
# 2018-09-10
# 2018-09-10 18:00
# 20180910-18:00:00
# 2018-09-10 18:00:00
# 1536573600(int)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zzzutils-0.1.6.tar.gz
(2.0 kB
view hashes)
Built Distribution
Close
Hashes for zzzutils-0.1.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 360591ce1cd6b3bd2eb625dcbed780bf54e38dc4a5e0bc8cef31c9d011c98e72 |
|
MD5 | f8324597489085816224b4836dcac746 |
|
BLAKE2b-256 | c20cb43535da3b1b5e2c521a6177a29707109f1805e93898a1dc0949e78b2eb8 |