js获取年月日

      const date = new Date()
      const options = { year: 'numeric', month: '2-digit', day: '2-digit' }
      const dateString = date.toLocaleDateString('zh-CN', options)
      const [year, month, day] = dateString.split('/')

      console.log(year, month, day)

人工智能学习网站:

https://chat.xutongbao.top

相关推荐

  1. js获取年月的格式

    2024-03-21 22:38:02       30 阅读
  2. js获取日期年初年末

    2024-03-21 22:38:02       12 阅读
  3. c语言-生成随机数、获取当前年月时分秒

    2024-03-21 22:38:02       16 阅读
  4. 结构体\年月

    2024-03-21 22:38:02       43 阅读
  5. 【笔记】flutter 日历年月自定义国际化显示

    2024-03-21 22:38:02       27 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-03-21 22:38:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-21 22:38:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-21 22:38:02       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-21 22:38:02       20 阅读

热门阅读

  1. 二、Eureka注册中心

    2024-03-21 22:38:02       17 阅读
  2. C语言—用题目辨析gets()与scanf()

    2024-03-21 22:38:02       22 阅读
  3. vue01

    2024-03-21 22:38:02       21 阅读
  4. SystemServer的面试题目

    2024-03-21 22:38:02       19 阅读
  5. 二、Spring源码学习之prepareRefresh方法

    2024-03-21 22:38:02       22 阅读
  6. 【LeetCode-46.全排列】

    2024-03-21 22:38:02       20 阅读
  7. RecyclerView万能适配器之BaseQuickAdapter方法详解

    2024-03-21 22:38:02       23 阅读
  8. Python PEP 8 代码风格指南

    2024-03-21 22:38:02       19 阅读