Skip to main content

# زمان خوانا

این یک تابع پایتون است که عددی غیر منفی (ثانیه) را به عنوان ورودی می‌گیرد و زمان را با
فرمت خوانا (ساعت:دقیقه:ثانیه) برمی‌گرداند.

## چگونه استفاده کنیم

1. مخزن را در دستگاه محلی خود کلون کنید.
2. تابع `make_readable1` یا`make_readable2` را از ماژول `human_readable_time` وارد کنید.
3. تابع `make_readable1` یا`make_readable2` را فراخوانی کنید و تعداد ثانیه‌ها را به عنوان آرگومان ارسال کنید.

مثال:

```python
from human_readable_time import make_readable1 #OR make_readable2

seconds = 3661
result = make_readable1(seconds)
print(result) # خروجی: 01:01:01
```

## جزئیات تابع

تابع `make_readable1` یا `make_readable2` ساعت، دقیقه و ثانیه را از تعداد داده شده ثانیه‌ها محاسبه کرده
و آن‌ها را با رشته‌ی خوانا فرمت می‌کند. این تابع از تابع `divmod()` برای محاسبه کارآمد و f-string برای
فرمت‌بندی خروجی با صفر اولیه استفاده می‌کند.

# Human Readable Time

This is a Python function that takes a non-negative integer representing the number of seconds and
returns the time in a human-readable format (HH:MM:SS).

## How to Use

1. Clone the repository to your local machine.
2. Import the `make_readable1` OR `make_readable2` function from the `human_readable_time` module.
3. Call the `make_readable1` OR `make_readable2` function and pass the number of seconds as an argument.

Example:

```python
from human_readable_time import make_readable1 #OR make_readable2

seconds = 3661
result = make_readable1(seconds)
print(result) # Output: 01:01:01
```

## Function Details

The `make_readable1` OR `make_readable2` functions calculates the hours, minutes, and seconds from
the given number of seconds and formats them in a human-readable string. It uses the `divmod()`
function for efficient calculation and f-string for formatting the output with leading zeros.


Release files for human-readable-time 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for human-readable-time 0.1.4
File Size Uploaded
human_readable_time-0.1.4.tar.gz 2.6 kB Details

Release files / human_readable_time-0.1.4.tar.gz

Download URL human_readable_time-0.1.4.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
169d9dc60d75285e2d2afd5d5e254aeb1a17e2e1404c9dcdead09f905bf9666a
BLAKE2b-256 checksum
How to use checksums
3c2d83c647e11e0da3f82ade9423c09b1ee7208f498a4b023503fa44b1569b2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 release file

0.1.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page