Skip to content

times doesn't work in nimscript #24292

Open
@metagn

Description

@metagn

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions