pymel.core.system.date

date(*args, **kwargs)

Returns information about current time and date. Use the predefined formats, or the -formatflag to specify the output format.

Flags:

Long Name / Short Name Argument Types Properties
date / d bool ../../../_images/create.gif
  Returns the current date. Format is YYYY/MM/DD
format / f unicode ../../../_images/create.gif
  Specifies a string defining how the date and time should be represented. All occurences of the keywords below will be replaced with the corresponding values: KeywordBecomesYYYYCurrent year, using 4 digitsYYLast two digits of the current yearMMCurrent month, with leading 0 if necessaryDDCurrent day, with leading 0 if necessaryhhCurrent hour, with leading 0 if necessarymmCurrent minute, with leading 0 if necessaryssCurrent second, with leading 0 if necessary
shortDate / sd bool ../../../_images/create.gif
  Returns the current date. Format is MM/DD
shortTime / st bool ../../../_images/create.gif
  Returns the current time. Format is hh:mm
time / t bool ../../../_images/create.gif
  Returns the current time. Format is hh:mm:ss Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.date

Example:

import pymel.core as pm

# Get the current date and time
pm.date()
# Result: u'2013/02/18 19:14:25' #
# Get only the month and day
pm.date( shortDate=True )
# Result: u'02/18' #
# Get the date and time in a fancy format
pm.date( format='Year is YY (or YYYY), month is MM, day is DD. And it is now hh:mm:ss' )
# Result: u'Year is 13 (or 2013), month is 02, day is 18. And it is now 19:14:25' #