Skip to main content
Version: 8.1*

This function is used in Python Scripting.


This function is a set of functions that include:

FunctionDescription the milliseconds from a date, ranging from 0-999. the second from a date, ranging from 0-59. the minutes from a date, ranging from 0-59. the hour from a date. Uses a 12 hour clock, so noon and midnight are returned as 0. the hour from a date. Uses a 24 hour clock, so midnight is zero. the day of the week from a date. Sunday is day 1, Saturday is day 7. the day of the month from a date. The first day of the month is day 1. the day of the year from a date. The first day of the year is day 1. the month from a date, where January is month 0. the quarter from a date, ranging from 1-4. the year from a date. a 0 if the time is before noon, and a 1 if the time is after noon.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.



DatedateThe date to use.


Integer - An integer that is representative of the extracted value.


Gateway, Vision Client, Perspective Session

Code Examples

Example #1
# This example would grab the current time, and print the current month.

date =
print #This would print the current month.
Example #2
# This example would create a date object, and print out the quarter of that date.

date =, 3, 15) #This would print "Mon April 15 00:00:00 PDT 2016"
print #This will print 2
Example #3
# This example can be placed on the action performed event of a button.
# It will then grab the day of the week of the calendar component,
# and enter the value returned into a numeric text field.

date = event.source.parent.getComponent('Calendar').date
event.source.parent.getComponent('Numeric Text Field').intValue =


system date get, date.get, date getMillis, date.getMillis, date getSecond, date.getSecond, date getMinute, date.getMinute, date getHour12, date.getHour12, date getHour24, date.getHour24,date getDayOfWeek, date.getDayOfWeek, date getDayOfMonth, date.getDayOfMonth, date getDayOfYear, date.getDayOfYear, date getMonth, date.getMonth, date getQuarter, date.getQuarter, date getYear, date.getYear, date getAMorPM, date.getAMorPM