View Issue Details

IDProjectCategoryView StatusLast Update
0009035MMW v4Framework: Scripts/Extensionspublic2012-01-29 05:24
Reporterpeke Assigned To 
PrioritynoneSeverityfeatureReproducibilityN/A
Status closedResolutionno change required 
Summary0009035: Converter for Delphi TDateTime to UTC
DescriptionAs some of MM.DB Fields are still in TDateTime Format (FileModified, TrackModified, LastTimePlayed, DateAdded) it is really hard for users to fetch direct SQL queries of MM.DB using these fields. Mostly due the Floating point Precission Error.

It would be nice to add Two Script Functions that will Convert Delphi TDateTime to UNIX UTC Truncating Milliseconds and Create TDateTime from UTC.

Eg.
TDateTime = REAL = <Number of Days>.<TTime in Float = 1000ms*60s*60m*24h = 1,157407407407407e-8>
TDateatetime = ~1 = Round(1,157407407407407e-8 * 86400001)

TagsNo tags attached.
Fixed in build

Activities

peke

2012-01-29 05:18

developer   ~0030135

Last edited: 2012-01-29 05:24

Fixed with user using:
<Days from 30-Dec-1899>+((Hours*3600+Minutes*60+Seconds)/86400)

Than results are used in SQL query like this to fetch added tracks:
"SELECT
Songs.ID,
Songs.Year,
Songs.Artist,
Songs.SongTitle
FROM
Songs
WHERE
Songs.DateAdded BETWEEN <Start Date> AND <End Date + 1 Second = End Result> AND NOT
Songs.DateAdded = <End Date + 1 Second = End Result to filter Exact +1 Second but to include all 999 ms>"