Skip to content

Commit cf22ada

Browse files
authored
Update layout to properly parse expiration_time string (#102)
closes: #101 The reference time "layout" var is incorrect and should have a different format: ``` layout := "2006-01-02T15:04:05Z07:00" ``` The 01 and 02 denote where the month and day string are located
1 parent be8b149 commit cf22ada

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cloud/resource_apikey.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func resourceApiKeyCreate(ctx context.Context, d *schema.ResourceData, m interfa
179179
}
180180
t = t.Add(ago)
181181
} else if expirationTime != "0" {
182-
layout := "2006-02-01T15:04:05Z"
182+
layout := "2006-01-02T15:04:05Z"
183183
t, err = time.Parse(layout, expirationTime)
184184
if err != nil {
185185
return diag.FromErr(fmt.Errorf("ERROR_PARSE_EXPIRATION_TIME: %w", err))

0 commit comments

Comments
 (0)