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
Copy file name to clipboardExpand all lines: docs/stdlib-times.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,7 @@ times := import("times")
72
72
2006" would be interpreted if it were the value; it serves as an example of
73
73
the input format. The same interpretation will then be made to the input
74
74
string.
75
+
-`parseInLocation(format string, s string, loc string)`: parseInLocation is like parse but parse interprets a time as UTC; parseInLocation interprets the time as in the given location.
75
76
-`unix(sec int, nsec int) => time`: returns the local Time corresponding to
76
77
the given Unix time, sec seconds and nsec nanoseconds since January 1,
77
78
1970 UTC.
@@ -88,6 +89,7 @@ times := import("times")
88
89
-`time_month(t time) => int`: returns the month of the year specified by t.
89
90
-`time_day(t time) => int`: returns the day of the month specified by t.
90
91
-`time_weekday(t time) => int`: returns the day of the week specified by t.
92
+
-`time_yearday(t time) => int`: returns the day of the year specified by t, in the range [1,365] for non-leap years, and [1,366] in leap years.
91
93
-`time_hour(t time) => int`: returns the hour within the day specified by t,
92
94
in the range [0, 23].
93
95
-`time_minute(t time) => int`: returns the minute offset within the hour
@@ -114,6 +116,7 @@ times := import("times")
114
116
t.
115
117
-`time_string(t time) => string`: returns the time formatted using the format
116
118
string "2006-01-02 15:04:05.999999999 -0700 MST".
119
+
-`to_location(t time, loc string)`: returns a copy of t representing the same time instant, but with the copy's location information set to loc for display purposes.
117
120
-`is_zero(t time) => bool`: reports whether t represents the zero time
118
121
instant, January 1, year 1, 00:00:00 UTC.
119
122
-`to_local(t time) => time`: returns t with the location set to local time.
0 commit comments