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

times doesn't work in nimscript #24292

Open
metagn opened this issue Oct 12, 2024 · 1 comment
Open

times doesn't work in nimscript #24292

metagn opened this issue Oct 12, 2024 · 1 comment

Comments

@metagn
Copy link
Collaborator

metagn commented Oct 12, 2024

Description

This fails to compile on nimscript (at least on windows):

import times

Despite getTime being implemented for the VM, it's not usable in nimscript for this reason. CompileDate/CompileTime are alternatives though.

Most of the Time support is fine, the problem is timezones and by extension DateTime (and epochTime and cpuTime but they are not as important). We could either:

  • Conditionally compile away all DateTime/Timezone code, though it's a couple hundred lines and thus might need to move to an include.
  • Add hooks for timezones in the VM.

Not sure which is easier.

This was also reported in #12540 but closed, maybe it worked for a period, maybe it's just broken on windows. Mentioned in #24168.

Nim Version

2.2, as far back as 1.6.14 for me

Current Output

lib\windows\winlean.nim(844, 20) Error: VM does not support 'cast' from tyPointer to tyProc

Expected Output

No response

Known Workarounds

CompileDate/CompileTime

Additional Information

No response

@juancarlospaco
Copy link
Collaborator

This is (or was?) documented, I remember it adding it on Nimscript docs or related.

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

No branches or pull requests

2 participants