Hello Ventuzians!
THE FORUMS ARE CLOSED!

Please join our discord server HERE!! << click me :D

We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server

Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!

Datetime Node

Post requests for new features to this forum group. Any suggestion to expand the possibilities of Ventuz are welcome.

Moderator: Support

Post Reply
Drac Zhang

Datetime Node

Post by Drac Zhang » 19 Nov 2014, 09:07

Hi,
When I use Datetime Node I found that it's so unconvientent to do some calculate, such as add some minutes.
So does it possible to add something to do it in the node?

Best Regards
Drac Zhang

User avatar
lerou
Posts: 345
Joined: 06 Sep 2013, 07:14
Location: Hamburg, Germany

Re: Datetime Node

Post by lerou » 25 Nov 2014, 12:06

Hi,

DateTime is very simple, use a script and put out whatever you need. See here for string format examples, here for documentation.

See attached vza for Ventuz example.

cheers,
rou
Attachments
DateTime.vza
(6.07 KiB) Downloaded 299 times

Drac Zhang

Re: Datetime Node

Post by Drac Zhang » 26 Nov 2014, 05:19

Hi,
Thanks for answering.
I know C# script can do this things. But I want to refresh the time every second I have to use a script and a datetime node to validate the new time.
So I think if the datetime node can do this, it will be much more convient.

Best Regards
Drac Zhang

User avatar
Eric_RD
Posts: 103
Joined: 04 Jun 2014, 14:01
Contact:

Re: Datetime Node

Post by Eric_RD » 05 Dec 2014, 17:42

You Can do that with a simple string Expression.
Create a string Expression with the following inputs:
DateTime, string
Day, int
Hour, int
Minute, int
Second, int

insert this for the Expression:
Convert.ToDateTime(DateTime,new System.Globalization.CultureInfo("en-US")).Add(new System.TimeSpan(Day, Hour, Minute, Second)).ToString()

Now connect the DateTime output of the DateTime Node with the DateTime input of this Expression.
You can now set positive or Negative values for Day, Hour, Min and Second

I'm not sure about the Cultureinfo. Even my System is Set to DD.MM.YYYY (and the DateTime Output shows it that way) it arrives at the String Expression as MM/DD/YYYY so you have to convert this.

Post Reply