国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

Datetime,Python(2017/02/04)

2019-11-14 09:25:35
字體:
來源:轉載
供稿:網友

References 1. Python for Data analysis 2. Useful Links https://docs.python.org/2/library/datetime.html

Step1: import packages from library

from datetime import datetime, date, time,timedelta

Background information,

date: contain attributes like year, month, day time: contain attributes like hour, minute, second, microsecond and tzinfo datetime: a combination of date and time, PRovide attributes year, month, day, hour, minute, second, microsecond, and tzinfo. timedelta: represents a duration, the difference between two dates or times.

from datetime import timedeltad = timedelta(microseconds=-1)(d.days, d.seconds, d.microseconds)

Step2: application of datetime

create user-written datetime

dt = datetime(2017,02,04,15,05,55) –> 2017/02/04 15:05:55

manipulation of datetime add 1 day to ‘dt’ dt2 = dt + timedelta(second = 86400) –> 2017/02/05 15:05:55 the difference between two dates (dt2 - dt).total_seconds()—> Return the total number of seconds contained in the duration
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 历史| 黄陵县| 宾阳县| 弋阳县| 如皋市| 温宿县| 六盘水市| 田东县| 石阡县| 容城县| 乐山市| 麻栗坡县| 花莲县| 铜陵市| 陈巴尔虎旗| 葫芦岛市| 海口市| 克拉玛依市| 琼中| 嵩明县| 博爱县| 体育| 新安县| 融水| 龙井市| 元氏县| 韶关市| 城口县| 中江县| 安宁市| 江安县| 新密市| 齐齐哈尔市| 贞丰县| 北流市| 望都县| 湖口县| 吉首市| 信宜市| 桂阳县| 罗江县|