Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Document creation time

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 381 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      On 08/10/2017 at 12:26, xxxxxxxx wrote:

      Hello plugincafe,

      a friend of mine asked me to write a litle plugin, where he can see how long he as wored on a project. My Idea was to get the creation date/time of the document and the current time in order to get the time between those.

      Now to my question:

      import c4d
      from c4d import gui
      #Welcome to the world of Python
        
        
      def main() :
          bc = doc.GetDocumentData()
          print bc.__getitem__(c4d.DOCUMENT_INFO_DATECREATED)
        
      if __name__=='__main__':
          main()
      

      This script should get me the creation date of the document. But the returned value seems to be quite large, and the python datetime module does not seem to take in such large numbers.

      I just don't know, how to correctly format this returned long value.
      Because it doesn't seem to be in milliseconds or any other formats I know.

      Am I just missing something, or is there a specific formation going on?

      regards,
      Florian

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 09/10/2017 at 03:12, xxxxxxxx wrote:

        Hi Neon, thanks for writing us.

        The fastest way to retrieve the information you're looking for is to use

          
        doc.GetParameter(c4d.DOCUMENT_INFO_DATECREATED_STRING,c4d.DESCFLAGS_GET_0)  
        

        Best, Riccardo

        1 Reply Last reply Reply Quote 0
        • First post
          Last post