Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The returned "zero" time is not Go zero time #10

Open
akhenakh opened this issue May 9, 2024 · 1 comment
Open

The returned "zero" time is not Go zero time #10

akhenakh opened this issue May 9, 2024 · 1 comment

Comments

@akhenakh
Copy link

akhenakh commented May 9, 2024

When suncalc is setting a zero time, for example a place where there is no night:

map[dawn:{dawn 1970-01-01 00:00:00 +0000 UTC} dusk:{dusk 1970-01-01 00:00:00 +0000 UTC} goldenHour:{goldenHour 2024-05-07 01:36:06.318270464 +0000 UTC} goldenHourEnd:{goldenHourEnd 2024-05-06 08:43:20.043806464 +0000 UTC} nadir:{nadir 2024-05-06 05:09:43.181038592 +0000 UTC} nauticalDawn:{nauticalDawn 1970-01-01 00:00:00 +0000 UTC} nauticalDusk:{nauticalDusk 1970-01-01 00:00:00 +0000 UTC} night:{night 1970-01-01 00:00:00 +0000 UTC} nightEnd:{nightEnd 1970-01-01 00:00:00 +0000 UTC} solarNoon:{solarNoon 2024-05-06 17:09:43.181038592 +0000 UTC} sunrise:{sunrise 1970-01-01 00:00:00 +0000 UTC} sunriseEnd:{sunriseEnd 2024-05-06 05:53:50.245779456 +0000 UTC} sunset:{sunset 1970-01-01 00:00:00 +0000 UTC} sunsetStart:{sunsetStart 2024-05-07 04:25:36.116297728 +0000 UTC}] 1970-01-01 00:00:00 +0000 UTC

it fills the zero times with 1970 (unix epoch) rather than the conventional Go zero time, it leads to IsZero returning false.

IsZero reports whether t represents the zero time instant, January 1, year 1, 00:00:00 UTC.

@sixdouglas
Copy link
Owner

Hi @akhenakh,

Sorry to come back so late.

I haven't been working on this repo lately. If you have any idea on how to fix this issue I'd be glad to merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants