Skip to content

Add Print/PrintLine overloads for SystemTime#59

Open
its-mohitkumar-7 wants to merge 1 commit into
rux-lang:devfrom
its-mohitkumar-7:feature/print-systemtime
Open

Add Print/PrintLine overloads for SystemTime#59
its-mohitkumar-7 wants to merge 1 commit into
rux-lang:devfrom
its-mohitkumar-7:feature/print-systemtime

Conversation

@its-mohitkumar-7

Copy link
Copy Markdown

Summary

Adds Print(value: SystemTime) / PrintLine(value: SystemTime) to
Print.rux.

Problem

UtcTime() / LocalTime() return SystemTime, but Print/PrintLine
had no overload for it:

error: no matching overload for 'Print' with argument types (SystemTime)

Fix

  • Added the two overloads to Src/Print.rux, plus
    import Std::Time::SystemTime;.
  • Added flat (non-nested) helpers PadTime2/PadTime3 for zero-padding —
    nested functions currently fail on the ELF linker.
  • Output format: YYYY-M-DD HH:MM:SS.mmm.

Scope

Only tested on Linux. SystemTime is a different type per target, so
I can't say if this works on Windows/macOS/BSD without checking there too.

Testing

Manually verified on Linux against all Std::Time functions via both
Print and PrintLine. LocalTime() output matches UtcTime(), as
expected since it currently just forwards to it on Linux.

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

Successfully merging this pull request may close these issues.

1 participant