Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/04/2008 at 07:59, xxxxxxxx wrote:
User Information: Cinema 4D Version: 10.111 Platform: Windows ; Mac ; Mac OSX ; Language(s) : C++ ;
--------- A simplified example: I want to output the current date in the C4D console. How do I do that?
I tried with the following code:
> LONG Year; \> LONG Month; \> LONG Day; \> GeGetSysTime(&Year;, &Month;, &Day;, NULL, NULL, NULL); \> GePrint("Date: " + LongToString(Day) + "." + LongToString(Month) + "." + LongToString(Year)); \>
LONG Year; \> LONG Month; \> LONG Day; \> GeGetSysTime(&Year;, &Month;, &Day;, NULL, NULL, NULL); \> GePrint("Date: " + LongToString(Day) + "." + LongToString(Month) + "." + LongToString(Year)); \>
But it makes Cinema crash immediately.
Thanks in advance
Greetings, Jack
On 06/04/2008 at 08:19, xxxxxxxx wrote:
OK OK, forget about it. I just mustn't use NULL...
Work fine now:
> LONG Year; \> LONG Month; \> LONG Day; \> LONG Hour; \> LONG Minute; \> LONG Second; \> GeGetSysTime(&Year;, &Month;, &Day;, &Hour;, &Minute;, &Second;); \> GePrint("Date: " + LongToString(Day) + "." + LongToString(Month) + "." + LongToString(Year));
LONG Year; \> LONG Month; \> LONG Day; \> LONG Hour; \> LONG Minute; \> LONG Second; \> GeGetSysTime(&Year;, &Month;, &Day;, &Hour;, &Minute;, &Second;); \> GePrint("Date: " + LongToString(Day) + "." + LongToString(Month) + "." + LongToString(Year));
Cheers, Jack
On 06/04/2008 at 08:31, xxxxxxxx wrote:
On 06/04/2008 at 08:51, xxxxxxxx wrote:
Btw. since Cinema 4D 10.5 you can do this in a more elegant way with the FormatTime() function.
> \> tagDateTime dt; \> DateTimeNow(dt); \> GePrint(FormatTime("%d.%m.%Y %H:%M:%S", dt)); \> \> // this outputs \> // 06.04.2008 17:47:25 \>
\> tagDateTime dt; \> DateTimeNow(dt); \> GePrint(FormatTime("%d.%m.%Y %H:%M:%S", dt)); \> \> // this outputs \> // 06.04.2008 17:47:25 \>
cheers, Matthias
On 08/04/2008 at 13:40, xxxxxxxx wrote:
Uuh, cool.
But the date & time thing was just an example. Anyway, very nice to know, thanks Matthias!
Also thanks to smiling RenatoT who gave me a slap on the forehead + the right tip to solve this