Skip to main content

A simple Python library for timezone formatting

Project description

TimePilot Lib 311x-011

TimePilot is a simple Python 3.11 library that helps you work with timezones and format them in different ways. With TimePilot, you can display the current time in a specific timezone or format a range of dates and times to appear in a particular way.

Installation

You can easily install TimePilot using pip. Simply run the following command:

pip install timepilot

How to Use

Here's an example of how you can use TimePilot to display the current time in the Eastern Timezone:

import timepilot

# Specify the timezone and formatting option you want to use
time_zone = "US/Eastern"
time_format = "hour_minute"

# Get the current time in the specified timezone and format
current_time = timepilot.get_current_time(time_zone, time_format)

# Print out the current time
print(f"The current time in {time_zone} is {current_time}")

We should get an output of something like this:

The current time in US/Eastern is 3:30 PM

Available Formatting Options

TimePilot provides several formatting options for displaying timezones, including:

  • hour_minute: displays the hour and minute (e.g. 3:30 PM)
  • hour_minute_second: displays the hour, minute, and second (e.g. 3:30:45 PM)
  • minute_second: displays the minute and second (e.g. 30:45)
  • hour: displays the hour (e.g. 3 PM)
  • second: displays the second (e.g. 45)

You can specify the formatting option when calling get_current_time or format_datetime.

Version

The current version of TimePilot is 311x-01, indicating that it is compatible with Python 3.11 and all sub-versions and the library version is 0.1.

License

TimePilot is released under the MIT License. You can find the license information in the LICENSE file.

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

timepilot-0.11.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file timepilot-0.11.tar.gz.

File metadata

  • Download URL: timepilot-0.11.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for timepilot-0.11.tar.gz
Algorithm Hash digest
SHA256 2feedb39729c3d4009b6b7a63ed30b92684b4ca84a8198f4645cfe41bf13ca26
MD5 81e871336b2211b9cb054eab4de1414d
BLAKE2b-256 3cb435af90fdd70dc67df1db5d8a7f4e70f74d4a87bfd349fe4d23f8b7d79e30

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page