TBC Macros and Extensions

 View Only
Expand all | Collapse all

License.GetCurrentDate() giving back a false Date (31.12.9999 23:59:59) - Issues with TBC´s public server to check the date over the internet?

  • 1.  License.GetCurrentDate() giving back a false Date (31.12.9999 23:59:59) - Issues with TBC´s public server to check the date over the internet?

    Posted 2 days ago

    Hi,

    first of all happy new year to the Trimble Community !

    We have used the License.GetCurrentDate() function to get back the current date for years, and it worked fine, however since a couple of days, we are getting a false date back: 

    31.12.9999 23:59:59

    Is it a TBC´s related internal issue due to complications accessing to the server that you use to check the date?

    Thanks a lot.

    Regards,

    Fernando



    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------


  • 2.  RE: License.GetCurrentDate() giving back a false Date (31.12.9999 23:59:59) - Issues with TBC´s public server to check the date over the internet?

    Posted 16 hours ago

    This has been found and will be addressed in an upcoming TBC release.
    It appears the external sources that we check the datetime from the web have stopped working/migrated and TBC will need a patch to address.  



    ------------------------------
    Bryce Haire
    ------------------------------



  • 3.  RE: License.GetCurrentDate() giving back a false Date (31.12.9999 23:59:59) - Issues with TBC´s public server to check the date over the internet?

    Posted 16 hours ago

    Hi Bryce,

    really appreciate your quick reply and info !

    Just in case anyone else is also struggling with this, we built a workaround for now using instead of:

             dateCurrent = License.GetCurrentDate()
    which is the one causing the issues now, an own function (dateFromInternet()), however dealing with proxy settings and urllib as we used it also in the past for some of our macros.
             dateCurrent = self.dateFromInternet()
    which basically requests the current date from the internet from different public date servers i.e.:

    res = urlopen('http://just-the-time.appspot.com/', timeout=5)
    result = res.read().strip()
    result_str = result.decode('utf-8')
    And after that, you do whatever needed in your macro with that date, format, etc.
    We used several different public servers (i.e. also res = urlopen('http://timeapi.io/api/Time/current/zone?timeZone=etc/utc', timeout=5) ) due to similar issues as the current one with GetCurrentDate() from the internal TBC API, however we still had some macros using the TBC own one and this was our issue now.
    Thanks again.
    Regards,
    Fernando


    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------