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

首頁(yè) > 學(xué)院 > 開(kāi)發(fā)設(shè)計(jì) > 正文

Datetime,Python(2017/02/04)

2019-11-14 10:50:43
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

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
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 祁连县| 泗阳县| 晋宁县| 黄梅县| 城固县| 巴楚县| 无极县| 海淀区| 隆林| 巫山县| 新安县| 嘉义县| 榆树市| 来凤县| 玉门市| 闻喜县| 红安县| 阳春市| 文成县| 绥中县| 连江县| 德化县| 吉安市| 峨山| 绵竹市| 清徐县| 苍南县| 寿光市| 天祝| 莎车县| 遵化市| 正镶白旗| 湛江市| 长沙县| 阳谷县| 南江县| 柯坪县| 上虞市| 连平县| 揭西县| 冷水江市|