photools.com Community

IMatch Discussion Boards => IMatch Scripting and Apps => Topic started by: ben on June 24, 2017, 09:58:50 PM

Title: /files endpoint with field=ts
Post by: ben on June 24, 2017, 09:58:50 PM
Hi Mario,

when i call the /v1/files endpoint (from python) with the fields parameter 'ts', then it returns "0.0" for each file.

My http request is:
http://127.0.0.1:50519/v1/files?auth_token=3f6fa5b10606071cdd246bc2d59d8c4c3d8270c1ac6faf1f67e42a7d38240b00&fields=id%2Cfilename%2Csize%2Cts&id=2934%2C2935%2C2936%2C2937%2C2938%2C2939%2C2940%2C2941%2C2942%2C2943


The response is:
{"files":[{"id":2934,"ts":0.000000,"fileName":"D:\\..\pic.jpg","size":491732},{"id":...

According to the documentation 'ts' means:
Date and time of the last modification of this object. Start point 30 December 1899, midnight = 0.0. See DATE data type in MSDN.

Any idea why?

Thanks,
Ben
Title: Re: /files endpoint with field=ts
Post by: Mario on June 25, 2017, 07:55:03 AM
I've made a check and it works here, and returns non-0 values.
What happens if you do a forced update for one of your files. Does the ts remain 0?
Title: Re: /files endpoint with field=ts
Post by: ben on June 25, 2017, 11:16:19 AM
ok, after a "force update" the values are non-zero, as well.
Weird. Currently i am only converting my old scripts and use the same functions on the database as before.
Thanks
Title: Re: /files endpoint with field=ts
Post by: ben on June 25, 2017, 11:31:21 AM
Hey Mario,

i found different definitions on the msdn websites (googling for it).

The start point is, right?: 30 December 1899, midnight = 0.0
Is this an int or float?
What does the "point" mean in "0.0"?
What's the resolution of this number?

Thanks,
Ben
Title: Re: /files endpoint with field=ts
Post by: Mario on June 25, 2017, 12:50:25 PM
It's a standard double timestamp as explained on MSDN:

https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k(WTYPES%2FDATE);k(DATE);k(DevLang-C%2B%2B);k(TargetOS-Windows)&rd=true

Maybe the timestamp was not set correctly? Is this an old file (long in the database)?
If this file was never modified (in the database) this ts will be 0.