Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UTCDateToTz ¶
UTCDateToTz converts a UTC date string to the specified timezone. It accepts date strings in "YYYY-MM-DD" format.
Example:
dateInNewYork, err := UTCDateToTz("2022-01-01", "America/New_York")
Parameters:
- utcDateString: a string representing the UTC date in "YYYY-MM-DD" format.
- timezone: a string representing the timezone (e.g., "America/New_York").
Returns:
- a string representing the converted date in "YYYY-MM-DD" format, or an empty string and an error if parsing fails.
func UTCDatetimeToTz ¶
UTCDatetimeToTz converts a UTC datetime string to the specified timezone. It accepts datetime strings in "YYYY-MM-DD HH:MM" format.
Example:
datetimeInNewYork, err := UTCDatetimeToTz("2022-01-01 10:00", "America/New_York")
Parameters:
- utcDatetimeString: a string representing the UTC datetime in "YYYY-MM-DD HH:MM" format.
- timezone: a string representing the timezone (e.g., "America/New_York").
Returns:
- a string representing the converted datetime in "YYYY-MM-DD HH:MM" format, or an empty string and an error if parsing fails.
func UTCTimeToTz ¶
UTCTimeToTz converts a UTC time string to the specified timezone. It accepts time strings in "HH:MM" format.
Example:
timeInNewYork, err := UTCTimeToTz("10:00", "America/New_York")
Parameters:
- utcTimeString: a string representing the UTC time in "HH:MM" format.
- timezone: a string representing the timezone (e.g., "America/New_York").
Returns:
- a string representing the converted time in "HH:MM" format, or an empty string and an error if parsing fails.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.