Documentation ¶
Overview ¶
Package time contains low-level utility functions for working with time.Time values and timezones.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertTimeZone ¶
ConvertTimeZone converts |datetime| from one timezone to another. |fromLocation| and |toLocation| can be either the name of a timezone (e.g. "UTC") or a MySQL-formatted timezone offset (e.g. "+01:00"). If the time was converted successfully, then the second return value will be true, otherwise the time was not able to be converted.
func MySQLOffsetToDuration ¶
MySQLOffsetToDuration takes in a MySQL timezone offset (e.g. "+01:00") and returns it as a time.Duration. If any problems are encountered, an error is returned.
func SecondsToMySQLOffset ¶
SecondsToMySQLOffset takes in a timezone offset in seconds (as returned by time.Time.Zone()) and returns it as a MySQL timezone offset (e.g. "+01:00").
func SystemTimezoneOffset ¶
func SystemTimezoneOffset() string
SystemTimezoneOffset returns the current system timezone offset as a MySQL timezone offset (e.g. "+01:00").
Types ¶
This section is empty.