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: bake/hclparser/stdlib.go
+55-1Lines changed: 55 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -129,6 +129,7 @@ var stdlibFunctions = []funcDef{
129
129
{name: "trimspace", fn: stdlib.TrimSpaceFunc},
130
130
{name: "trimsuffix", fn: stdlib.TrimSuffixFunc},
131
131
{name: "try", fn: tryfunc.TryFunc, descriptionAlt: `Variadic function that tries to evaluate all of is arguments in sequence until one succeeds, in which case it returns that result, or returns an error if none of them succeed.`},
Description: `Given a unix timestamp integer, will parse and return an object representation of that date and time. A unix timestamp is the number of seconds elapsed since January 1, 1970 UTC.`,
Copy file name to clipboardExpand all lines: docs/bake-stdlib.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,7 @@ title: Bake standard library functions
104
104
|[`trimspace`](#trimspace)| Removes any consecutive space characters (as defined by Unicode) from the start and end of the given string. |
105
105
|[`trimsuffix`](#trimsuffix)| Removes the given suffix from the start of the given string, if present. |
106
106
|[`try`](#try)| Variadic function that tries to evaluate all of is arguments in sequence until one succeeds, in which case it returns that result, or returns an error if none of them succeed. |
107
+
|[`unixtimestampparse`](#unixtimestampparse)| Given a unix timestamp integer, will parse and return an object representation of that date and time. A unix timestamp is the number of seconds elapsed since January 1, 1970 UTC. |
107
108
|[`upper`](#upper)| Returns the given string with all Unicode letters translated to their uppercase equivalents. |
108
109
|[`urlencode`](#urlencode)| Applies URL encoding to a given string. |
109
110
|[`uuidv4`](#uuidv4)| Generates and returns a Type-4 UUID in the standard hexadecimal string format. |
@@ -1409,6 +1410,40 @@ target "webapp-dev" {
1409
1410
}
1410
1411
```
1411
1412
1413
+
## `unixtimestampparse`
1414
+
1415
+
The returned object has the following attributes:
1416
+
*`year` (Number) The year for the unix timestamp.
1417
+
*`year_day` (Number) The day of the year for the unix timestamp, in the range 1-365 for non-leap years, and 1-366 in leap years.
1418
+
*`day` (Number) The day of the month for the unix timestamp.
1419
+
*`month` (Number) The month of the year for the unix timestamp.
1420
+
*`month_name` (String) The name of the month for the unix timestamp (ex. "January").
1421
+
*`weekday` (Number) The day of the week for the unix timestamp.
1422
+
*`weekday_name` (String) The name of the day for the unix timestamp (ex. "Sunday").
1423
+
*`hour` (Number) The hour within the day for the unix timestamp, in the range 0-23.
1424
+
*`minute` (Number) The minute offset within the hour for the unix timestamp, in the range 0-59.
1425
+
*`second` (Number) The second offset within the minute for the unix timestamp, in the range 0-59.
0 commit comments