Time
The Time registry provides tools to manage and manipulate dates, times, and time-related calculations, making it easy to handle time-based data in your projects.
Last updated
The Time registry provides tools to manage and manipulate dates, times, and time-related calculations, making it easy to handle time-based data in your projects.
Last updated
You can easily import all the functions from the time
registry by including the following import statement in your code
The function formats a given date or the current time into a specified format string.
The function formats a given date or the current time into a specified format string for a specified timezone.
The function converts a given number of seconds into a human-readable duration string.
The function calculates the time elapsed since a given date.
dateAgo
can receive multiples input types like:
time.Time
object (object or pointer)
int
, int32
, int64
converted as Unix
The function returns the current time.
The function returns the Unix epoch timestamp for a given date.
The function adjusts a given date by a specified duration, returning the modified date. If the duration format is incorrect, it returns the original date without any changes, in case of must version, an error are returned.
The function rounds a duration to the nearest significant time unit, such as years or seconds.
The function formats a date into the standard HTML date format (YYYY-MM-DD).
This basically call dateInZone("2006-01-02", date, "Local")
The function formats a date into the standard HTML date format (YYYY-MM-DD) based on a specified timezone.
This basically call dateInZone("2006-01-02", date, zone)
Signature
Must version
Signature
Must version
Signature
Must version
Signature
Must version
Signature
Must version
Signature
Must version
Signature
Must version
Signature
Must version
Signature
Must version
Signature
Must version