Skip to main content

For calculating time difference from current time to Target time and can detect a time from our natural language

Project description

from AlarmTime.AlarmTime import DetectDate

##############################################

t = DetectDate(1570000023345) print(t.now) #2019-10-02 13:07:39.393012 t = DetectDate('2019/5/2/14/5') print(t.now) #2019-05-02 14:05:39.393185 t = DetectDate() print(t.now) #2019-04-21 12:26:12.542967 ############################################

t = DetectDate()

target_time = t.DateTimeDetect('detect the time and date on December 16 8 p.m') print(target_time)

target_time = t.DateTimeDetect('detect the time and date on December 16 ') print(target_time)

target_time = t.DateTimeDetect('after 700 days') print(target_time)

target_time = t.DateTimeDetect('after 6 month 700 days 8 hour 5 minute') print(target_time)

target_time = t.DateTimeDetect('after 700 days') print(target_time)

now we can get the value of target year, day, month, hour, minute, second print(target_time.day)

============================================================================= 2019-04-21 12:26:12.542967 2019-12-16 20:00:00.542967 2019-12-16 00:00:00.542967 2021-03-21 12:26:12.542967 2021-09-20 20:31:12.542967 2021-03-21 12:26:12.542967 21

minute_diff = t.minute_diff_from_now('after 1 days')

print(minute_diff) #1440.0

hour_diff = t.hour_diff_from_now('after 1 days')

print(hour_diff) #24.0

day_diff = t.day_diff_from_now('after 1 days')

print(day_diff) #1.0

sec_diff = t.second_diff_from_now('after 1 days')

print(sec_diff) #86400.0

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

AlarmTime-0.1.4.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

AlarmTime-0.1.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file AlarmTime-0.1.4.tar.gz.

File metadata

  • Download URL: AlarmTime-0.1.4.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for AlarmTime-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5a95d9f94a981ae9ca0cb48b2d5174ba131fca516b845f600bb006d89209d114
MD5 6681250b5e8ca3dde5a66125e9347332
BLAKE2b-256 40ab0cf5e7a59054c0cee54458e475e757776e5937143acdb1f0dee078103103

See more details on using hashes here.

File details

Details for the file AlarmTime-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: AlarmTime-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for AlarmTime-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ee48bb9953de2b84c39f9b38d76cf29642255540fa05b677d6b9fb6150257120
MD5 39bd6656adee07958c2bf97aac449038
BLAKE2b-256 4305c1154b24bdb88c59b25aeb979268b6f24a7c07df41079c4a213be3eb9ae4

See more details on using hashes here.

Supported by

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