Is it possible to add -/+ to Switch date variable?
I want to compare to my tomorrow date, and not the present that is stated.
Ive tried:
[Switch.date]+1d
[Switch.date]+86400000
Including format and timezone it should look like this (but then also adding 1 day if possible)
[Switch.Date:Format="yyyy-MM-dd hh:mm",TimeZone=System]
The incoming xml have the date entered like this "201406191600", using the metadata and "date" doesn't work and gives me no value, if I change the date in the xml to "2014-06-18T16:20:38.483" it works...
Is it possible to change this in switch or to scheme it to work? I really would like to do this without scripting (if possible) and now change the xml (it comes from third part).
Add +1 day to [Switch.date]?
There are three things you have to combine and experiment with, but it can be done without scripting.
First, when using Switch-Date use the Format field to get the date in the form you need: yyyyMMdd will give you 20140619 instead of the full date and time (look at the tooltip!).
Second, use Switch-Calculation to add 1 to this number.
Third, you will have to put the recalculated date and the not recalculated time (Format: hhmm) together when comparing with the XML value.
I have not worked it out completely, but I am sure these hints can lead to a solution.
Freddy
First, when using Switch-Date use the Format field to get the date in the form you need: yyyyMMdd will give you 20140619 instead of the full date and time (look at the tooltip!).
Second, use Switch-Calculation to add 1 to this number.
Third, you will have to put the recalculated date and the not recalculated time (Format: hhmm) together when comparing with the XML value.
I have not worked it out completely, but I am sure these hints can lead to a solution.
Freddy
-
dkelly
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
First, when using Switch-Date use the Format field to get the date in the form you need: yyyyMMdd will give you 20140619 instead of the full date and time (look at the tooltip!).
Second, use Switch-Calculation to add 1 to this number.
This will fail for the last day of a month or year
Second, use Switch-Calculation to add 1 to this number.
This will fail for the last day of a month or year
-
lovestjarna
- Newbie
- Posts: 18
- Joined: Mon May 26, 2014 3:50 pm
@dkelly Im reading from an xml file. So the "format" doesnt do anything with the input, only the output. Changing the date to the common "8601" makes the date work. I was hoping to be able to NOT change the date asking third part company to change their files.
The code putted in here above, should that then be used in the "define condition", comparing that to the metadata "date"?
The code putted in here above, should that then be used in the "define condition", comparing that to the metadata "date"?