I've been attempting to use the functions ReloadTIme() or now(0) which as far as I can tell are identical, to output the last successful reload time for exception reporting purposes, e.g. to warn users when the data is behind.
In my main qvws, neither function is working. Reloadtime() outputs nothing, while now(0) outputs 'day zero' (30/12/1899). I assume the only difference in outputs it due to their default formatting options.
However, I most certainly have reloaded these files many times. In other existing documents, and in new test documents on the same system (Windows Server 2012 Standard) the functions work just fine:
Testing on a newly created which has never been reloaded or saved, I still get a result for now(0) which equals its creation time, though ReloadTime() is blank:
I guessed reload method could have something to do with it, as the two main documents that don't work (first screenshot above) are running on scheduled reloads. However, testing on other scheduled documents works fine and reload times are correct.
Any ideas? My other thought is that is could be because both documents' scheduled reload happened to fail today (which is why I was looking to add the checks), but if the method doesn't work when the documents fail then it completely defeats the purpose.
Solved! Go to Solution.
Hello MikeSwinn, I'm facing the same issue with QV 11.20.12354.0409 (SR6 I believe) when using -prj folders. Once I delete -prj folders everything works fine. After creating them again reload time is lost. Seems like a bug to me.
I've heard that now(1), which is the default functionality of now() can be dangerous as it's the current system time and and refreshes every second or more frequently, so would agree with you there.
However, I wouldn't expect now(0) to affect unless it's poorly implemented, since the value must only be reset at reload time.
Good points about adding it to the script, seems better practice anyhow. But I still would be interested to see why the functions are not working in some cases, seems like a bug to me.
When I add reloadtime() to a text object in the documents where it wasn't working, the behaviour is the same, is shows up as blank, and now(0) in such documents as 30/12/1899 00:00:00
Is your reload using the standard server schedule or something else?
If a reload fails the document should remain "as-is" and retain the reload time from the last successful reload