Posts

Showing posts with the label date in Jython wsadmin

Jython Date and time formats experiment

Basic date and time formats in Jython This is common requirement in most of our WAS administration tasks. You need the date or time formats in the following tasks: Back of the deployment units such as .war or .ear or .jar files Log file rotations Monitoring report logs with time stamps Update the Logger with time stamp Jython allow us to use time object only from Python module. other two date, datetime objects are not available in Jython. Lets experiments with the time object and its different functions in a simple script: import time timetuple=time.localtime() print "Time tuple:", timetuple print "Time tuple with loop" for t in timetuple: print t # Week of the day print "Today Weekday in short:",time.strftime('%a') print "Today Weekday in full:", time.strftime('%A') # Month of the date print "This month in short:", time.strftime('%b') print "This month in full:", time.strftime('%...