Hello, Is it possible (in Houdini, Windows) to somehow extract the current time and date? I would like to append the resulting string to the name of my many test render frames… It appears that of all the variables defined on the system, one cannot extract only the Date and Time
diula Hello, Is it possible (in Houdini, Windows) to somehow extract the current time and date? I would like to append the resulting string to the name of my many test render frames… It appears that of all the variables defined on the system, one cannot extract only the Date and Time
Any ideas?
You could use system expression and do something like:
set a = `system(“date +%T”)` —> 18:08:16 or set a = `system(“date +%D”)` —-> 10/22/06 or set a = `system(“date +%D_%T”)` —-> 10/22/06_18:08:16
Hope this helps a bit
Cheers, Rob Digital Supervisor | Stargate Studios Toronto
a bunch of UNIX utils very easy to install: - Download - Put the folder where ever you want - Make sure that the environment var PATH has the directory where UnxUtils is installed….
It works without any UNIX tools. Basicly date is a cmd application, so you need to call it something like this (I forgot the exact syntax and no Houdini near me):
I spend some time trying diferent system commands in the name but every timei try this the sting gets split somehow and i end up with an unnumbered 0 kb file where the name ends after the system command.
This can be done as a one-liner but it requires some pretty esoteric Python formatting because it needs to import the datetime module before running datetime.now().strftime(). Try something like this:
Running __import__ this way and converting the whole thing to a string allows you to import, run the function, and return the result as a string for pythonexprs to read all at once. It's ugly but it works. If you want something a little easier to modify, you could create a string-type spare parm and set the default expression to this Python statement:
Henry, Please excuse the tardiness of this reply - but thank you so much for this excellent and useful post. I will be putting it to use later this week. I've used a date and time token frequently in other 3D software, and very much missed it in Houdini - but no longer : )