提交 c422f319 编写于 作者: A a946547732

Auto Commit

上级 ca207a2f
run = "npm i && npm run dev"
language = "node"
[env]
PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}"
XDG_CONFIG_HOME = "/root/.config"
npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global"
\ No newline at end of file
npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global"
[debugger]
program = "main.js"
console.log("欢迎来到 InsCode");
\ No newline at end of file
function 计算当前月一共有几天() {
// 获取当前年份和月份
const year = new Date().getFullYear();
const month = new Date().getMonth() + 1; // 注意月份是从0开始的,需要加1
// 计算当前月份的天数
const daysInMonth = new Date(year, month, 0).getDate();
return daysInMonth;
}
const days = 计算当前月一共有几天();
console.log(days); // 输出当前月份的天数
function getDayOfMonth() {
const today = new Date();
const year = today.getFullYear();
const month = today.getMonth();
const firstDayOfMonth = new Date(year, month, 1);
const diffMs = today.getTime() - firstDayOfMonth.getTime();
const diffDays = Math.ceil(diffMs / (1000 * 60 * 60 * 24));
return diffDays;
}
const dayOfMonth = getDayOfMonth();
console.log(`今天是本月的第 ${dayOfMonth} 天`);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册