Skip to main content

simple to date and time conver

Project description

# simpletime
##### A module for converting dates and times.

***

**Supported objects include :**

1. datetime.datetime
2. datetime.date
3. datetime.time
4. timestamp(float/int)
5. time.time.struct_time
6. string(%Y-%m-%d %H:%M:%S)

***

+ if date argument is lost, use the current date instead
+ if time argument is lost, use 00:00:00 instead
+ if date and time are lost, use now instead

***

**Function list:**

1. toDatetime()
2. toDate()
3. toTime() #always return int object
4. toStamp()
5. toTuple()
6. toString()

**If do not provide a object to conver, the function return current time**

***

```
>>> import simpletime as st
>>> st.toDatetime()
datetime.datetime(2019, 1, 15, 22, 29, 8, 185436)
>>> st.toString()
'2019-01-15 22:29:13'
>>> st.toStamp()
1547562563
>>> st.toDatetime('2019-01-01 01:02:03')
datetime.datetime(2019, 1, 1, 1, 2, 3)
>>> st.toStamp('2019-01-01 01:02:03')
1546275723
```

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

simpletime-0.0.8.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file simpletime-0.0.8.tar.gz.

File metadata

  • Download URL: simpletime-0.0.8.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.0

File hashes

Hashes for simpletime-0.0.8.tar.gz
Algorithm Hash digest
SHA256 e637b66d7767fd036a3e59f2a7241c25d0e591e9fe05603b50dc574858a1ae31
MD5 1c9a69afae5c8aed501cdbccbcc8c049
BLAKE2b-256 1b913aa3b51ff15ef52b46ea23c90a000abb996c87cf34b29fba67fc2dcbfac6

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