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.

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
Complete Current Statement
Add trailing commas or braces and move the cursor to the right place with a single keystroke.
Code Completion in Language Injections
Code Completion in Language Injections
See how to use code completion inside strings and other places.
Completion for non-imported Go Modules
Completion for non-imported Go Modules
Import a module in to your project.