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.

Files for simpletime, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size simpletime-0.0.8.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page