You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
It's important to use the date timezone if it has any.
## Changes
Do not switch back to Local timezone if not needed
## Fixes#81
## Checklist
- [X] I have read the **CONTRIBUTING.md** document.
- [X] My code follows the code style of this project.
- [X] I have added tests to cover my changes.
- [X] All new and existing tests passed.
- [ ] I have updated the documentation accordingly.
- [ ] This change requires a change to the documentation on the website.
## Additional Information
<!-- Any additional information regarding this pull request. -->
Timezones are always fun
---------
Signed-off-by: ccoVeille <[email protected]>
Co-authored-by: Atomys <[email protected]>
The function formats a given date or the current time into a specified format string.
21
21
22
-
<tabledata-header-hidden><thead><tr><thwidth="174">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><preclass="language-go"><codeclass="lang-go"> Date(fmt string, date any) (string, error)
22
+
<tabledata-header-hidden><thead><tr><thwidth="174">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><preclass="language-go"><codeclass="lang-go"> Date(layout string, date any) (string, error)
23
23
</code></pre></td></tr></tbody></table>
24
24
25
25
{% tabs %}
@@ -34,7 +34,7 @@ The function formats a given date or the current time into a specified format st
34
34
35
35
The function formats a given date or the current time into a specified format string for a specified timezone.
36
36
37
-
<tabledata-header-hidden><thead><tr><thwidth="124">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><preclass="language-go"><codeclass="lang-go">DateInZone(fmt string, date any, zone string) (string, error)
37
+
<tabledata-header-hidden><thead><tr><thwidth="124">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><preclass="language-go"><codeclass="lang-go">DateInZone(layout string, date any, zone string) (string, error)
38
38
</code></pre></td></tr></tbody></table>
39
39
40
40
{% tabs %}
@@ -121,7 +121,7 @@ The function returns the Unix epoch timestamp for a given date.
121
121
122
122
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 is returned.
123
123
124
-
<tabledata-header-hidden><thead><tr><thwidth="164">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><preclass="language-go"><codeclass="lang-go">DateModify(fmt string, date time.Time) (time.Time, error)
124
+
<tabledata-header-hidden><thead><tr><thwidth="164">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><preclass="language-go"><codeclass="lang-go">DateModify(layout string, date time.Time) (time.Time, error)
0 commit comments