Interval between timestamps

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
2 posts Page 1 of 1

asmund

Posts: 2
Joined: Mon Mar 24, 2014 8:25 am

Post by asmund » Mon Jan 05, 2015 5:48 am
Is it possible to get the interval between two timestamps as a scalar number, or to have the timestamp task return a scalar value, for example an astronomical Julian day? I need to loop over (Year, DOY) for a date range that may include Jan 1, and it would be nice to not have to handle the year change manually.

Support_Rick

Support Specialist
Posts: 590
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Mon Jan 05, 2015 8:56 am
asmund,

On the TIMESTAMP Task .. there is a Date Manipulation Tab. This will allow you to create a Date Variable (yyyyDDD) implicitly or based on current date.

This means that you can specifically give it the Year, Month, Day and it will create the variable for that date.

Code: Select all
<timestamp version="1.0">
	<format outputVariable="JulDate" pattern="yyyyDDD" dayOfMonth="21" month="7" year="2015" />
</timestamp>

01/05/2015 06:40:36           INFO      Executing task 'print 1.0'
01/05/2015 06:40:36           INFO      Julian Date->  2015202
01/05/2015 06:40:36           INFO      Finished task 'print 1.0'
Or, you could manipulate based on current date:
Code: Select all
<timestamp version="1.0">
	<format outputVariable="JulDate" pattern="yyyyDDD" month="+15" />
</timestamp>

01/05/2015 06:43:18           INFO      Executing task 'print 1.0'
01/05/2015 06:43:18           INFO      Julian Date->  2016096
01/05/2015 06:43:18           INFO      Finished task 'print 1.0'
Your only other option is to call an SQL Function to return the value you are looking for based on some date manipulation algorithm. An option for this might be to create a Utility Project that returns a single value from an SQL Function. There is a function here on the Forum called SQL Help that might give you some direction on this option.

SQL Help
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
2 posts Page 1 of 1