Time Based Utility Tools
Project description
vutime
Time Based Utility Tools for Python
Installation
pip install vutime
Usage
Adding Times
from vutime import add_time
# Add two times in HH:MM:SS format
result = add_time("10:30:43", "07:53:49")
print(result) # Output: 18:24:32
# Add times with different formats
result = add_time("10:30", "05:45", time_format_1="HH:MM", time_format_2="HH:MM", return_format="HH:MM:SS")
print(result) # Output: 16:15:00
Subtracting Times
from vutime import subtract_time
# Subtract two times (time1 must be greater than time2)
result = subtract_time("10:30:43", "07:53:49")
print(result) # Output: 02:36:54
# Subtract times with custom formats
result = subtract_time("10:30", "05:45", time_format_1="HH:MM", time_format_2="HH:MM")
print(result) # Output: 04:45:00
Getting Timezone Information
from vutime.conversions.timezones import get_timezone
# Get timezone information for a specific identifier
tz_info = get_timezone("Asia/Tokyo")
print(tz_info)
# Output: {'identifier': 'Asia/Tokyo', 'sign': '+', 'offset': '09:00'}
Converting Time Between Timezones
from vutime.conversions.timezones import convert_time_tz
# Convert time from one timezone to another
result = convert_time_tz("12:00:00", "America/New_York", "Asia/Tokyo")
print(result) # Output: 02:00:00 (next day)
# Convert with custom time formats
result = convert_time_tz("14:30", "Europe/London", "America/Los_Angeles",
time_format="HH:MM", return_format="HH:MM")
print(result) # Output: 06:30
Format Options
Supported time formats:
HH:MM:SS- Hours, minutes, seconds (default)HH:MM- Hours, minutesMM:SS- Minutes, seconds
Supported Timezone Identifiers
The following is a complete list of all supported timezone identifiers (563 total):
Visit List of all TZs for a list of all timezone identifiers used.
Requirements
- Python 3.12+
License
MIT
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
vutime-0.2.1.tar.gz
(4.7 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 vutime-0.2.1.tar.gz.
File metadata
- Download URL: vutime-0.2.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eacea9bd072093ecab2f0e65daad1dc14556102e3335d27ec64d60309fd6c8c3
|
|
| MD5 |
cd7b3c0b074170890909daab76c5e015
|
|
| BLAKE2b-256 |
c0d232f0545d58446f6d77adad5079bb42a27ac41c26c8935adb4c5ee6faa322
|
File details
Details for the file vutime-0.2.1-py3-none-any.whl.
File metadata
- Download URL: vutime-0.2.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c8564cb72d72a7853b4eaa121385f994fbec1917c2ef65adae1d81ff43a39fc
|
|
| MD5 |
fa771e72d0382ed50bb1c0a4f93073b4
|
|
| BLAKE2b-256 |
442ea9000fd6fcba13117ae3434c71243097b8c59e580e7de36379d8b6f0594f
|