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
```
##### 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 hashes)