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: YYYYYYMMDDhhmmss KeywordBecomesCurrent year, using 4 digitsLast two digits of the current yearCurrent month, with leading 0 if necessaryCurrent day, with leading 0 if necessaryCurrent hour, with leading 0 if necessaryCurrent minute, with leading 0 if necessaryCurrent second, with leading 0 if necessaryFlag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

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

Derived from mel command maya.cmds.date

Example:

import pymel.core as pm

import maya.cmds as cmds

# Get the current date and time
pm.date()
# Result: u'2011/11/11 16:43:29' #
# Get only the month and day
pm.date( shortDate=True )
# Result: u'11/11' #
# 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 11 (or 2011), month is 11, day is 11. And it is now 16:43:29' #

Previous topic

pymel.core.system.dagObjectCompare

Next topic

pymel.core.system.dbcount

Core

Core Modules

Other Modules

This Page