cool hit counter Server Room Charging System - Calculate the time difference between two dates with the DateDiff function_Intefrankly

Server Room Charging System - Calculate the time difference between two dates with the DateDiff function


Copyright: This is an original post by the blogger and may not be reproduced without the blogger's permission. https://blog.csdn.net/huyuyang6688/article/details/10991371

When the server room charges do the up and down part, you need to calculate the time difference between up and down to calculate the cost spent during the up period.

At this point, it can be done simply with a function - DateDiff() - using the following rules.

DateDiff(timeinterval,date1,date2 [, firstdayofweek [, firstweekofyear]])

The function returns the time elapsed from date1 to date2, and timeinterval indicates the type of time interval (i.e., the unit of measure of time), respectively.

Year yyyy

Quarterly q

Month m

Day of the year y

Date d

Week ww

Hours h

Minutes n

seconds s

Milliseconds ms

Examples.

example:DateDiff("q",#1991-01-01#,#1992-01-01#) return to4

DateDiff(“yyyy”,#1991-01-01#,#2000-01-01#) return to9

DateDiff("n",#06:00:00#,#07:05:04#) return to65

DateDiff("h",#06:00:00#,#07:05:04#) return to1

……


Recommended>>
1、KeyShot6 Installation Diagram
2、New Cloud East Wins 2017 Outstanding Product Award for Autonomous and Controlled High Performance Computing Servers
3、Ether developers propose new ERC865 standard token instead of ETH to pay for transactionsgas
4、Carscom Debuts at ASC 2018 Begins Era of Connected Vehicle Cloud Services
5、The sweeper transported a broom to me Is it an artificial intelligence or an artificial retard

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号