Skip to content

Fix and optimize TDMS_TimeSecond#2

Open
mizmar wants to merge 4 commits intoMahdaSystem:masterfrom
mizmar:master
Open

Fix and optimize TDMS_TimeSecond#2
mizmar wants to merge 4 commits intoMahdaSystem:masterfrom
mizmar:master

Conversation

@mizmar
Copy link

@mizmar mizmar commented Feb 10, 2026

Fix bug in TDMS_TimeSecond where year 1904 started counting days from 0, but other years from 1. Now holds that TDMS_TimeSecond(1904, 1, 1, 0, 0, 0) == 0.

Sadly, the official docs LabVIEW Timestamp Overview have an incorrect time for 2002-01-01 00:00:00, it should be TDMS_TimeSecond(2002, 1, 1, 0, 0, 0) == 3092688000, not 3092601600. This is discussed in this forum post.

Additionally optimize full years. Instead of looping over all months, directly add 365 days (or 366 for leap year). This is roughly 10x speedup.

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