Create time and datetime objects using slice notation
Project description
slicetime
Create time and datetime objects using slice notation.
Importing slicettime overrides the standard library datetime objects
so be sure to place it before actually using datetime. Otherwise, continue
to use date
, datetime
, and time
as before. But when you need an instance
with a new time, use the digital clock notation to create it
[hh:mm:ss.mmmmmm]
When the time
class is called with this new notation, a new time instance
is created and returned. When an existing either date
or datetime
is
called with this new notation, a new datetime
instance is returned that
has the same date as the original instance, but the time specified in the
slice.
Example
import datetime
import slicetime
new_time = datetime.time[12:30:5.55]
assert new_time.hour == 12
assert new_time.minute == 30
assert new_time.second == 5
assert new_time.microsecond == 55
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
Built Distribution
File details
Details for the file slicetime-0.1.tar.gz
.
File metadata
- Download URL: slicetime-0.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84b83c0af473fa1f83e42d03a10b5a045e2be31d6a7d7c4a1cf92c3eabb7eba4 |
|
MD5 | 815ecb5c82d29aab7a37e9f69e37b168 |
|
BLAKE2b-256 | 606d30d7fffaf11dcb6b350cb0d06e20d82b421e73a12a3f3be8a883dc6e8440 |
File details
Details for the file slicetime-0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: slicetime-0.1-py2.py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e78ebcd065c24baf4838f288446cf56ed80a02f7b21d0804d683e5d6cf50d313 |
|
MD5 | f194d39214ebb482e7e1353ea25c8efe |
|
BLAKE2b-256 | 95a6f227a761e19b60c4cb87be86001e9b4283cc00d35143fe503714ee9f248e |