Skip to content

date_epoc fails to convert date from cyrilic #818

@mslavkov

Description

@mslavkov

Describe the bug
When locale is set to Bulgarian (bg_BG.UTF-8) date is unable to convert the string to check the certificate validity.
...
local cert is for domains: www.example.tld
Failed conversion of Feb 5 05:16:58 2024 GMT'' using format %b %d %T %Y %Z''
date: illegal time format
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]

www.example.tld: certificate needs renewal
...

After adding LC_ALL=C in front of date in date_epoc function:

...
local cert is valid until Feb 5 05:25:12 2024 GMT

local cert is for domains: www.example.tld
www.example.tld: certificate is valid for more than 30 days (until Feb 5 05:25:12 2024 GMT)
...

To Reproduce
On bsd system set locale to Bulgarian (bg_BG.UTF-8) and try to renew cert.

Expected behavior
local cert is valid until Feb 5 05:25:12 2024 GMT

local cert is for domains: www.example.tld
www.example.tld: certificate is valid for more than 30 days (until Feb 5 05:25:12 2024 GMT)

Operating system (please complete the following information):

  • OS: FreeBSD
  • Bash Version 5.2.15 (GNU)

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions