Nedir?
İki tarih değeri arasındaki farkı TimeSpan olarak tutar, bu değer format yöntemleri ile kullanılır.
Form Verisi
<Production> <User Name="Deniz" SurName="Kocaboğa" LastLogin="2009-12-06T22:00:00Z">205</User> <User Name="Ertan" SurName="Tike" LastLogin="2009-12-06T21:12:10Z">411</User> </Production>
Örnek sentaks a göre her iki Value değeri de tarih değerini tutar ve arasındaki farkı timespan yani tipinde $(Result) değerine yazar. örn:1.00:30:00 bunun anlamı 1 gün 30 dakika demektir.
Sentaks
<SetVariable Name="$(Result)"> <TimeSpan> <Value Target="Date">::/Production/User[1]/@LastLogin</Value> <Value Target="Date">::/Production/User[1]/@LastLogin</Value> </TimeSpan> </SetVariable>
Örnekler
$(Result) yazı tipinde bir değerdir ve bu değer /Production/User[1]/@LastLogin yolunda bulunan tarih ile /Production/User[2]/@LastLogin yolunda bulunan tarihi çıkarır ve sonucu gun.saat:dakika:saniye.salise olarak sonuç değerini tutar.
Örnek
<SetVariable Name="$(Result)"> <String Format="" Culture=""> <TimeSpan> <Value Target="Date">::/Production/User[1]/@LastLogin</Value> //2009-12-06T22:00:00Z <Value Target="Date">::/Production/User[1]/@LastLogin</Value> //2009-12-06T21:12:10Z </TimeSpan> </String> </SetVariable>
Result : 00:47:50