Maya Get Date and Time

proc string getDateAndTime()
{
        python("import datetime");
        python("d = datetime.datetime.now()");
        return python("d.strftime('%Y-%m-%d-%Hh%Mm%Ss')");
};
getDateAndTime;
// Result: 2011-08-03-20h24m56s //

 

Just a quick note about how to get date and time via MEL and Python

Advertisements

Leave a comment

Filed under MEL, Python

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s