Go Time an Online Golang Date Format Tool

大地缸 · · 737 次点击 · · 开始浏览    
这是一个创建于 的文章,其中的信息可能已经有所发展或是发生改变。


title: "Go Time an Online Golang Date Format Tool"
date: 2021-01-26T21:27:06+08:00
draft: true
tags: ['go']
author: "dadigang"
author_cn: "大地缸"
personal: "http://www.real007.cn"


关于作者

http://www.real007.cn/about

Go Time - An online Golang date format tool

Oct 16, 2015

Go Time - an online Golang date format tool

I’m often frustrated by Go’s syntax for date-time parsing. The docs explain the concept: you write the reference date (January 2nd, 2006 at 3:04:05PM in the MST time zone) in the format you want to parse or print. They provide a few examples, but the only complete list of format parts is in the time package codebase. It’s not really user-friendly.

To make things easier, I wrote a quick webapp that parses Go date-time formats and explains the components. The page also includes a complete list of all the different formats for each part of the string, with explanation. Try it here.

Technologically, there’s no Go involved in this project - the page uses a line-for-line Javascript reimplementation of the Go format-string parser to produce the explanations. The list of symbols and explanations were also taken directly from format.go. In the future I’m planning to port the parser responsible for applying the patterns, so we can have in-browser testing of patterns against example strings.

Ramblings, collected.


有疑问加站长微信联系(非本文作者)

本文来自:简书

感谢作者:大地缸

查看原文:Go Time an Online Golang Date Format Tool

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

737 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传