While autoscripting, bear in mind that even though the syntax of your script may be Python or JavaScript, your script is executing in the Java Virtual Machine that is running Maximo. That means you have at your fingertips all of the native Java libraries as well as all the third-party libraries that Maximo comes with.
To get date parts out of a java.util.Date, which will be returned by your `currentMbo.getDate("lastrun")` call, you need to use that Date to create a Calendar, e.g. java.util.GregorianCalendar, that is set to your Date, and then pull the date parts out of the Calendar.
You can find documentation on the native Java libraries here: GregorianCalendar (Java Platform SE 8 ) (oracle.com)
------------------------------
Jason Uppenborn
Cohesive
------------------------------
Original Message:
Sent: 06-06-2023 09:22
From: Deepa P
Subject: Compare dates in automation script
Hi,
I have this below query,
) currentset=mxserver.getMboSet("taskschedular",userInfo)
currentset.setWhere(" taskname like '%pmwogen%) currentMbo= currentSet.getMbo(0)
datepmwogen = currentMbo.getDate("lastrun")
Now if datepmwogen value is 2022-12-05 , how do i extract the month,year,date and compare with todays date month year and date , in a script?
#Administration
#Analytics
#Architecture
#Assets
#CivilInfrastructure
#Customizations
#EndUser
#EverythingMaximo
#HSE/OilandGas
#Infrastructure
#Integrations
#Inventory
#IoT
#LifeScience/Calibration
#Linear
#MaximoApplicationSuite
#MaximoForAviation
#MaximoUserGroups
#Mobility
#Nuclear
#Procurement
#Reporting
#Scheduling
#Security
#ServiceProvider
#Spatial
#Transportation
#Utilities
#WorkCenters
#WorkManagement
------------------------------
Deepa P
------------------------------