New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wucpeng-tools

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wucpeng-tools - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

timeConvert.js

3

index.js
module.exports.holiday = require('./holiday.js');
module.exports.calendar = require('./calendar.js');
module.exports.zip = require('./zip.js');
module.exports.zip = require('./zip.js');
module.exports.timeConvert = require('./timeConvert.js');
{
"name": "wucpeng-tools",
"version": "1.0.4",
"version": "1.0.5",
"description": "time date holiday lunar",

@@ -24,3 +24,7 @@ "main": "index.js",

},
"homepage": "https://github.com/wucpeng/wucpeng-tools#readme"
"homepage": "https://github.com/wucpeng/wucpeng-tools#readme",
"dependencies": {
"month-days": "^2.1.0",
"sprintf": "^0.1.5"
}
}

@@ -62,2 +62,31 @@ ## wucpeng-tools ##

zip.zipFile(workPath, fileName, (err)=> {});
zip.zipFile(workPath, fileName, (err)=> {});
## Feature timeConvert 时间转换 ##
const tools = require('wucpeng-tools');
const timeConvert = tools.timeConvert;
功能 | 变量 | 参数 | 返回值
获取时间小时信息 | getHour | date offsetInSeconds | number
获取本年度第一周时间 | getFirstWeekDayOfYear | date | Date
获取星期时间 | getWeek | date | 0-6
获取时间 | getDayAndWeek | date | x号-周x
是否零点时间 | isZeroTime | timeInt | true or false
判断是否周一 | isMonthFirstDayTime | timeInt | true or false
获取日期零点时间 | getZeroTime | intTime | Date
获取月份零点时间 | getZeroMonthTime | intTime | Date
获取年份零点时间 | getZeroYearTime | intTime | Date
获取一周开始时间(周一) | getZeroWeekTime | intTime | Date
获取当月每天时间 | getMonthDays | intTime | Array [intTime]
判断时间是否是时间格式 | checkTimeIsSet | date | boolean
获取时间字符串 | getTimeYMDH | intTime | 格式: 2015年12月3日8:30
获取时间字符串 | getTimeYMD | intTime | 格式: 2015年12月3日
获取时间字符串 | getTimeYM | intTime | 格式: 2015年12月
获取时间字符串 | getTimeHM | intTime | 格式: 08:30
判断是否同一天 | isSameDay | date1, date2 | boolean
是否当前月 | isCurrentMonth | date | boolean
判断是否是同一天 | isSameDayFormat | time1, time2 | boolean
根据开始时间和天数计算时间 | calcDateByDays | begin, days | Date
计算年龄 | calcAge | dateTime | age
计算年龄 | calcAgeAndMonth | birthYear, birthMonth, birthDate | {year: number, month: number, date: number}
计算时间差距 | calcDateDiff | beginDate, endDate | {year: number, month: number, date: number}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc