/files endpoint with field=ts

Started by ben, June 24, 2017, 09:58:50 PM

Previous topic - Next topic

ben

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

Mario

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?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ben

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

ben

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

Mario

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.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook