Better time format in completion

Use the commonly known date/time formatting strings while writing time formatting in Go

It's no secret that Go uses different references for formatting date/time. When coming from other programming languages, you may try to use YYYY instead of Go's 2006 string to format the year. This is where GoLand can help you by suggesting the common date/time formats, such as YYYY or DD and converting them to Go's formatting directives.

How to use:

Start typing any common date/time formatting strings, such as YYYY or DD and the IDE will convert them automatically. You can also use other identifiers, such as year or day, to activate this feature. This works for both time.Time.Format and time.Parse functions.


Related Resources

Complete Current Statement
Add trailing commas or braces and move the cursor with a single keystroke
Code Completion in Language Injections
See how to use code completion inside strings and other places
Completion for non-imported Go Modules
Import a module even if it was imported or used in your project