4

Understanding Go's Time Format

 1 year ago
source link: https://www.ardanlabs.com/blog/2022/12/understanding-go-time-format.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Subscribe to the Ardan Labs Insider

You’ll get our FREE Video Series & special offers on upcoming training events along with notifications on our latest blog posts.

Understanding Go's Time Format

Author image

Cheikh Seck

December 16, 2022

Introduction

Most apps that work with time values eventually need to display time to a user. Go has a unique way of allowing you to specify how to display time values that is different from the C library function strftime. The strftime function tends to be the standard for languages and tooling to format time. Go developed its own format specification instead of using any existing format with the idea of being able to maintain a mental model for formatting time.

In this video, join Ayan as he explores Go’s time format specification and helps you build intuition for formatting time in Go. Ayan will start by writing a program that will take keyboard input that specifies the layout to use to display the current time. This approach is effective as he visually demonstrates how time formatting works in Go. He also covers common pitfalls to anticipate when working with a time layout.

Things you will learn in this video

  • How to build intuition to format time with Go.
  • Format and display time with Go.
  • The pitfalls to avoid while formatting time.

Video

Go Training

We have taught Go to thousands of developers all around the world since 2014. There is no other company that has been doing it longer and our material has proven to help jump start developers 6 to 12 months ahead of their knowledge of Go. We know what knowledge developers need in order to be productive and efficient when writing software in Go.

Our classes are perfect for both experienced and beginning engineers. We start every class from the beginning and get very detailed about the internals, mechanics, specification, guidelines, best practices and design philosophies. We cover a lot about "if performance matters" with a focus on mechanical sympathy, data oriented design, decoupling and writing production software.

Capital One
Cisco
Visa
Teradata
Red Ventures

Interested in Ultimate Go Corporate Training and special pricing?

Let’s Talk Corporate Training!

Join Our Online
Education Program

Our courses have been designed from training over 30,000 engineers since 2013, and they go beyond just being a language course. Our goal is to challenge every student to think about what they are doing and why.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK