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

datefmt() function adds an hour to the actual time. #849

Open
niceiq opened this issue Oct 4, 2023 · 7 comments
Open

datefmt() function adds an hour to the actual time. #849

niceiq opened this issue Oct 4, 2023 · 7 comments

Comments

@niceiq
Copy link

niceiq commented Oct 4, 2023

This issue has been annoying me for the past hour or so. I am just getting into date and time input with sc-im, but I haven't found anything on my issue.

I have the following string cell: 2023.10.02 9:56:32, I formatted it using datefmt %Y.%m.%d %H:%M%S, but I have the following result: 2023.10.02 10:56:32.

As you can see, the 9 became 10.

I'm sure it's someting silly and I'm either blind or stupid, but some help would be appreciated!

@andmarti1424
Copy link
Owner

andmarti1424 commented Oct 4, 2023

What do you have in set in tm_gmtoff configuration variable..? You may have to adjust it.
EDIT: if you are off by an hour try reducing it or increasing it by 3600..

@niceiq
Copy link
Author

niceiq commented Oct 4, 2023

The issue persists. I tried adding and subtracting 3600, but neither has any effect.

@andmarti1424
Copy link
Owner

What value do you have configured?

@niceiq
Copy link
Author

niceiq commented Oct 4, 2023

image

The default value is 10800, I had it set at both 7200 and 14400 (+- 3600). datefmt stills shows the wrong hour.

@andmarti1424
Copy link
Owner

I wonder if this has something to do with your LOCALE

@niceiq
Copy link
Author

niceiq commented Oct 4, 2023

I don't know.

The output of date is Wed Oct 4 16:10:05 EDT 2023. I am in the right timezone in everything.

It's the epoch timestamp that it gets wrong when I do datefmt from the string.

image

But when I convert the same date using date on my system, it works fine:

image

@niceiq
Copy link
Author

niceiq commented Oct 6, 2023

I wonder if this has something to do with your LOCALE

I think it has something to do with my timezone.

I am currently on Eastern Daylight Time, which of course, adds an hour to to my time during the summer.

image

However, the date command on my system outputs the right thing, but it looks like the datefmt() command in sc-im is confused with that. Is there a way in the config to zet the time zone to EST? I think this might fix the issue.

Thank you.

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