golang 通过ISOWeek翻转得到周的日期时间
来源:互联网 发布:猎豹浏览器精简优化版 编辑:程序博客网 时间:2024/05/22 04:51
func firstDayOfISOWeek(year int, week int, timezone *time.Location) time.Time { date := time.Date(year, 0, 0, 0, 0, 0, 0, timezone) isoYear, isoWeek := date.ISOWeek() for date.Weekday() != time.Monday { // iterate back to Monday date = date.AddDate(0, 0, -1) isoYear, isoWeek = date.ISOWeek() } for isoYear < year { // iterate forward to the first day of the first week date = date.AddDate(0, 0, 1) isoYear, isoWeek = date.ISOWeek() } for isoWeek < week { // iterate forward to the first day of the given week date = date.AddDate(0, 0, 1) isoYear, isoWeek = date.ISOWeek() } return date}
0 0
- golang 通过ISOWeek翻转得到周的日期时间
- 通过输入的时间time得到第二天的日期
- golang 中的日期时间
- golang -- 时间日期总结
- java通过当前日期得到本周的起止日期
- 通过FILETIME得到时间
- 通过FILETIME得到时间
- Golang 日期时间格式format()
- 坑爹的golang日期时间格式format()
- 坑爹的golang日期时间格式format()
- java/android 编程实现通过日期得到当前的星期
- javascript日期处理-通过一个字符串的日期得到所在周、上周及下周的第一天和最后一天
- 如何得到当前时间日期
- Solaris 如何得到昨天,前天的时间日期
- VC中得到当前的系统时间 日期
- VC中得到当前系统的时间和日期
- 用CTime类得到当前的日期 时间
- 根据时间戳得到常见的日期格式
- java网络编程____httpclient工具类操作
- 在父页面中局部刷新子iframe
- 前端进阶---from表单---
- HTML5——网页绘画板
- CSDN文章中代码高亮显示
- golang 通过ISOWeek翻转得到周的日期时间
- commons-lang3-3.1.jar在BuildPath导入后运行仍报错:ClassNotFoundException: org.apache.commons.lang3.StringUtil
- sql语句--更新表中所有数据的某些字段
- 感知器Perceptron
- 代码回归
- Executors创建线程池的四种方法
- 在.NET Core 上运行的 WordPress
- Android studio Declaring custom 'clean' task when using the standard Gradle lifecycle解决方法
- js模拟时钟