This is my RetryIntervel Time duration “00:00:30”
how to convert into Timestamp through config variable.
Thanks in advance.
This is my RetryIntervel Time duration “00:00:30”
how to convert into Timestamp through config variable.
Thanks in advance.
Variables
Assign Activity
Assign Activity
Use the ‘timestamp’ variable as needed in your workflow.
Refer below file as refernce
test.zip (2.4 KB)
Hope it helps you out
Strinput = “00:00:30”
var_timespan = TimeSpan.Parse(Strinput.ToString)
//Note: DataType of var_timespan is System.TimeSpan
var_timestamp= DateTime.Now.Add(var_timespan)
//Note: DataType of var_timestamp is System.DateTime
Sequence1.xaml (7.2 KB)
Hope it helps!!
Another option is just to put the number of seconds into the config file. Then you can simply use
TimeSpan.FromSeconds(CInt(Config(“timeStamp”).ToString))
@ManjunathReddy
How about following syntax.
Can you show how you saved the value in config…looks like the cell is formatted as date…try to convert to general and just save 30 and then use the formula
Cheers
Hi @ManjunathReddy
Try this:
TimeSpan.FromSeconds(Convert.ToInt64(Config(RetryInterval).ToString()))
Hope it helps!!
I understood the formula…but value you are getting from config looks like a timestamp…try to change that in config and it should work
Cheers
just do this
timespan.FromSeconds(30)
In the config the Value (00:00:03) is Text type.
I have used These two syntaxes but no use.
TimeSpan.FromSeconds(CInt(Config(RetryInteraval).ToString))
TimeSpan.FromSeconds(CDbl(Config(RetryInteraval).ToString))
Thanks
Hi @ManjunathReddy
Try this syntax:
TimeSpan.FromSeconds(Convert.ToInt64(Config(RetryInterval).ToString()))
Hope it helps!!
Because you’ve typed 00:00:30 into Excel it has interpreted it as a datetime and when you read the value you’re getting 12/30/1899 00:00:30. This is one of the reasons I suggested just putting the number of seconds into Excel and then using TimeSpan.FromSeconds
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.