网站公告

本次更新:新公告样式

详细教程:vitepress.yiov.top

QQ 频道:******(无效二维码)

Skip to content

getQuarterOfYear获取季度

更新: 1970/1/1 字数: 0 字 时长: 0 分钟

说明

getQuarterOfYear 是一个计算给定日期是当年第几季度的函数。

参数描述
date给定的日期,默认为当前日期,可以是 Date(JavaScript Date 对象)。

返回值

  • 返回一个 number,表示给定日期是当年的第几季度。

示例

js
import { getQuarterOfYear } from 'uviewos';

// 获取当前日期是当年的第几季度
const currentQuarter = getQuarterOfYear();
console.log(currentQuarter); // 输出当前日期是当年的第几季度

// 获取指定日期是当年的第几季度
const specificDate = new Date('2024-09-07');
const quarterOfSpecificDate = getQuarterOfYear(specificDate);
console.log(quarterOfSpecificDate); // 输出指定日期是当年的第几季度

Released under the MIT License.

本站访客数 人次 本站总访问量