AnyLogic 6 Discussion

I'm trying to extend the PrintWriter class in a separate java class, and I can't seem to get the function "time()" to resolve. I can't find which package to import for "time()" to be recognized. I've tried all the com.xj.anylogic packages, but no matter which ones I import, it still won't resolve. It resolves fine in Additional Code in an Active Object, and everywhere else I try to use it, except for separate classes. Any help would be appreciated!
To answer my own question: Pass down the ActiveObject that is creating the class in the class constructor, and (assuming objActiveObject is the ActiveObject you are passing in) use: objActiveObject.getEngine().time() In other words, time(), date(), etc. are methods of the Engine class, and you need to get the current Engine for the simulation you're running, so use the getEngine method of an ActiveObject to let the class know which engine to use. Hope this helps someone else!