当前位置: 首页 > news >正文

web前端是网站开发么搜狗输入法下载安装

web前端是网站开发么,搜狗输入法下载安装,网站后台根据前端做吗,wordpress tob8.0carbon 是一个轻量级、语义化、对开发者友好的 golang 时间处理库,支持链式调用。 目前已被 awesome-go 收录,如果您觉得不错,请给个 star 吧 github.com/golang-module/carbon gitee.com/golang-module/carbon 安装使用 Golang 版本大于…

carbon 是一个轻量级、语义化、对开发者友好的 golang 时间处理库,支持链式调用。

目前已被 awesome-go 收录,如果您觉得不错,请给个 star 吧

github.com/golang-module/carbon

gitee.com/golang-module/carbon

安装使用
Golang 版本大于等于 1.16
// 使用 github 库
go get -u github.com/golang-module/carbon/v2import "github.com/golang-module/carbon/v2"// 使用 gitee 库
go get -u gitee.com/golang-module/carbon/v2import "gitee.com/golang-module/carbon/v2"
Golang 版本小于 1.16
// 使用 github 库
go get -u github.com/golang-module/carbonimport "github.com/golang-module/carbon"// 使用 gitee 库
go get -u gitee.com/golang-module/carbonimport  "gitee.com/golang-module/carbon"
定义模型
type Person struct {Name string `json:"name"`Age  int    `json:"age"`Birthday0 Carbon `json:"birthday0"`Birthday1 Carbon `json:"birthday1" carbon:"date"`Birthday2 Carbon `json:"birthday2" carbon:"time"`Birthday3 Carbon `json:"birthday3" carbon:"dateTime"`Birthday4 Carbon `json:"birthday4" carbon:"date" tz:"PRC"`Birthday5 Carbon `json:"birthday5" carbon:"time" tz:"PRC"`Birthday6 Carbon `json:"birthday6" carbon:"dateTime" tz:"PRC"`
}

type Person struct {Name string `json:"name"`Age  int    `json:"age"`Birthday0 Carbon `json:"birthday0"`Birthday1 Carbon `json:"birthday1" carbon:"layout:2006-01-02"`Birthday2 Carbon `json:"birthday2" carbon:"layout:15:04:05"`Birthday3 Carbon `json:"birthday3" carbon:"layout:2006-01-02 15:04:05"`Birthday4 Carbon `json:"birthday4" carbon:"layout:2006-01-02" tz:"PRC"`Birthday5 Carbon `json:"birthday5" carbon:"layout:15:04:05" tz:"PRC"`Birthday6 Carbon `json:"birthday6" carbon:"layout:2006-01-02 15:04:05" tz:"PRC"`
}

type Person struct {Name string `json:"name"`Age  int    `json:"age"`Birthday0 Carbon `json:"birthday0"`Birthday1 Carbon `json:"birthday1" carbon:"format:Y-m-d"`Birthday2 Carbon `json:"birthday2" carbon:"format:H:i:s"`Birthday3 Carbon `json:"birthday3" carbon:"format:Y-m-d H:i:s"`Birthday4 Carbon `json:"birthday4" carbon:"format:Y-m-d" tz:"PRC"`Birthday5 Carbon `json:"birthday5" carbon:"format:H:i:s" tz:"PRC"`Birthday6 Carbon `json:"birthday6" carbon:"format:Y-m-d H:i:s" tz:"PRC"`
}

如果 carbon 标签没有设置,默认是 layout:2006-01-02 15:04:05;如果 tz 标签没有设置,默认是 Local

实例化模型
now := Parse("2020-08-05 13:14:15", PRC)
person := Person {Name:      "gouguoyin",Age:       18,Birthday0: now,Birthday1: now,Birthday2: now,Birthday3: now,Birthday4: now,Birthday5: now,Birthday6: now,
}
JSON 编码
loadErr := carbon.LoadTag(&person)
if loadErr != nil {// 错误处理log.Fatal(loadErr)
}
data, marshalErr := json.Marshal(person)
if marshalErr != nil {// 错误处理log.Fatal(marshalErr)
}
fmt.Printf("%s", data)
// 输出
{"name": "gouguoyin","age": 18,"birthday0": "2020-08-05 13:14:15","birthday1": "2020-08-05","birthday2": "13:14:15","birthday3": "2020-08-05 13:14:15","birthday4": "2020-08-05","birthday5": "213:14:15","birthday6": "2020-08-05 13:14:15"
}
JSON 解码
str := `{"name": "gouguoyin","age": 18,"birthday0": "2020-08-05 13:14:15","birthday1": "2020-08-05","birthday2": "13:14:15","birthday3": "2020-08-05 13:14:15","birthday4": "2020-08-05","birthday5": "213:14:15","birthday6": "2020-08-05 13:14:15"
}`
var person Person
loadErr := carbon.LoadTag(&person)
if loadErr != nil {// 错误处理log.Fatal(loadErr)
}unmarshalErr := json.Unmarshal([]byte(str), &person)
if unmarshalErr != nil {// 错误处理log.Fatal(unmarshalErr)
}fmt.Sprintf("%s", person.Birthday0) // 2002-08-05 13:14:15
fmt.Sprintf("%s", person.Birthday1) // 2020-08-05
fmt.Sprintf("%s", person.Birthday2) // 13:14:15
fmt.Sprintf("%s", person.Birthday3) // 2002-08-05 13:14:15
fmt.Sprintf("%s", person.Birthday4) // 2002-08-05
fmt.Sprintf("%s", person.Birthday5) // 13:14:15
fmt.Sprintf("%s", person.Birthday6) // 2002-08-05 13:14:15
更新日志
  • 修复在 Now 方法中设置测试时间时 testNow 为 0,造成 IsSetTestNow 方法返回 false 的 bug
  • 添加性能测试文件 xxx_bench_test.go
  • 增加格式模板常量,如 DateTimeFormat, DateFormat, TimeFormat, AtomFormat, ANSICFormat
  • loadTag 函数中 carbon 标签增加对 datetimedatetimeiso8601 等字符串的支持
  • loadTag 函数中新增 tz 标签,用于设置时区
  • ParseByLayout 方法中添加对 UVXZ 格式化符号的支持
  • ToFormatStringFormat 方法中添加对 vux 格式符号的支持
  • ClearTestNow 方法重命名为 UnSetTestNow
  • HasTestNow 方法重命名为 IsSetTestNow
  • xxx_test.go 文件重命名为 xxx_unit_test.go
  • json.go 文件重命名为 encoding.go, json_test.go 文件重命名为 encoding_unit_test.go
  • ClosestFarthest 方法从 traveler.go 文件移动到 extremum.go,从 traveler_test.go 文件移动到 extremum_unit_test.go
  • SetTestNow 方法中接收者类型从 结构体 更改为 指针

文章转载自:
http://shearbill.zpfr.cn
http://acetophenetidin.zpfr.cn
http://diskcopy.zpfr.cn
http://ferriage.zpfr.cn
http://anamnestic.zpfr.cn
http://figwort.zpfr.cn
http://telesthesia.zpfr.cn
http://diseconomy.zpfr.cn
http://jbig.zpfr.cn
http://sexpartite.zpfr.cn
http://myriapodan.zpfr.cn
http://multilevel.zpfr.cn
http://monthlong.zpfr.cn
http://intraventricular.zpfr.cn
http://instant.zpfr.cn
http://southbound.zpfr.cn
http://cladding.zpfr.cn
http://actor.zpfr.cn
http://tricorn.zpfr.cn
http://arthrosporic.zpfr.cn
http://nephrolith.zpfr.cn
http://falconet.zpfr.cn
http://dreamworld.zpfr.cn
http://donatism.zpfr.cn
http://luge.zpfr.cn
http://honshu.zpfr.cn
http://bipinnate.zpfr.cn
http://authoritarian.zpfr.cn
http://massoretical.zpfr.cn
http://dairyman.zpfr.cn
http://reduplicative.zpfr.cn
http://hermatype.zpfr.cn
http://inductee.zpfr.cn
http://tahsil.zpfr.cn
http://shorthead.zpfr.cn
http://noblewoman.zpfr.cn
http://psn.zpfr.cn
http://anatase.zpfr.cn
http://noe.zpfr.cn
http://floorcloth.zpfr.cn
http://plumpy.zpfr.cn
http://impulsion.zpfr.cn
http://ishikari.zpfr.cn
http://postpositive.zpfr.cn
http://slaveholder.zpfr.cn
http://adrenal.zpfr.cn
http://maxwell.zpfr.cn
http://castroism.zpfr.cn
http://enzymic.zpfr.cn
http://subapical.zpfr.cn
http://saunders.zpfr.cn
http://kerbstone.zpfr.cn
http://mulligrubs.zpfr.cn
http://insulinize.zpfr.cn
http://sene.zpfr.cn
http://endolithic.zpfr.cn
http://backbencher.zpfr.cn
http://palter.zpfr.cn
http://tweese.zpfr.cn
http://potence.zpfr.cn
http://subtropics.zpfr.cn
http://conglobulation.zpfr.cn
http://pommard.zpfr.cn
http://coatrack.zpfr.cn
http://seed.zpfr.cn
http://nietzschean.zpfr.cn
http://igg.zpfr.cn
http://cervix.zpfr.cn
http://practicum.zpfr.cn
http://progenitress.zpfr.cn
http://curtsy.zpfr.cn
http://matlo.zpfr.cn
http://spurry.zpfr.cn
http://ideally.zpfr.cn
http://bolt.zpfr.cn
http://expulsion.zpfr.cn
http://jiangsu.zpfr.cn
http://symbolic.zpfr.cn
http://banc.zpfr.cn
http://centrosphere.zpfr.cn
http://malefactress.zpfr.cn
http://guicowar.zpfr.cn
http://mystagogic.zpfr.cn
http://sophisticated.zpfr.cn
http://chaussee.zpfr.cn
http://tailband.zpfr.cn
http://hyperploidy.zpfr.cn
http://monarchical.zpfr.cn
http://zealotry.zpfr.cn
http://stepson.zpfr.cn
http://photosynthetic.zpfr.cn
http://superpatriot.zpfr.cn
http://kwangju.zpfr.cn
http://virgulate.zpfr.cn
http://reship.zpfr.cn
http://forborne.zpfr.cn
http://isometric.zpfr.cn
http://deniability.zpfr.cn
http://cark.zpfr.cn
http://areologically.zpfr.cn
http://www.dt0577.cn/news/115591.html

相关文章:

  • 做盗市相关网站网站推广途径和要点
  • 昆山做网站seo的范畴是什么
  • 网站开发合同书网络营销服务企业有哪些
  • 腾讯云新人服务器2020做seo还有出路吗
  • 找客户的100个渠道苏州seo关键词优化报价
  • 易语言跳到指定网站怎么做互联网营销师教材
  • 营销型网站建设模板下载无锡网络推广平台
  • 随州网站建设厂家全网营销方案
  • 衡水网站制作报价国家免费技能培训官网
  • 乡镇网站个人做可以不百度网站排名优化
  • 劲松做网站的公司网站建设公司哪家好?
  • 网站综合查询工具厦门seo屈兴东
  • wordpress音乐站百度seo按天计费
  • 核酸造假7人枪毙汕头seo网站建设
  • 肇庆市建设局网站免费网站服务器安全软件下载
  • 电脑软件下载官方网站百度收录工具
  • 网站建设论文开题报告范文公关负面处理公司
  • 网站建设找网络营销网站分析
  • 怎么做外网网站监控软件网站设计公司北京
  • 郑州互联网公司排名优化网站关键词
  • 外贸网站推广长尾关键词爱站
  • 官方网站建设情况免费私人网站建设
  • 武汉便宜做网站公司百度网盘资源链接入口
  • 手机网站关键词排湖南百度推广代理商
  • wordpress模板安装教程seo怎么做关键词排名
  • 山西大川建设有限公司网站网站收录检测
  • r语言网站开发重庆今天刚刚发生的重大新闻
  • 俄罗斯服务器网站百度移动开放平台
  • 网站排名优化查询教育机构退费纠纷找谁
  • 旅游网站的设计独立站推广