Nedir?
İki tarih değeri arasındaki farklı verilen birime göre hesaplar ve çevirir.
<SetVariable Name="$(Result)">
<DateTimeDifference Part="Second">
<Value Target="Date">::/Production/User[1]/@LastLogin</Value>
<Value Target="Date">::/Production/User[2]/@LastLogin</Value>
</DateTimeDifference>
</SetVariable>
<Production>
<User Name="Deniz" SurName="Kocaboğa" LastLogin="2008-04-28T18:00:00Z">205</User>
<User Name="Ertan" SurName="Tike" LastLogin="2008-04-29T10:00:00Z">411</User>
</Production>
Örnek sentaks a göre her iki Value değeri de tarih değerini tutar ve arasındaki farkı integer yani sayı tipinde $(Result) değerine yazar.
Özellikler
Adı | Açıklama | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Part | Birim Bölümü bu bölümde bildirilir.
|
Örnekler
$(Result) sayı 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 Minute(Dakika) olarak sonuç değerini tutar.
<SetVariable Name="$(Result)">
<DateTimeDifference Part="Minute">
<Value Target="Date">::/Production/User[1]/@LastLogin</Value>
<Value Target="Date">::/Production/User[2]/@LastLogin</Value>
</DateTimeDifference>
</SetVariable>
$(Result) sayı 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 Hour(Saat) olarak sonuç değerini tutar.
<SetVariable Name="$(Result)">
<DateTimeDifference Part="Hour">
<Value Target="Date">::/Production/User[1]/@LastLogin</Value>
<Value Target="Date">::/Production/User[2]/@LastLogin</Value>
</DateTimeDifference>
</SetVariable>
$(Result) sayı 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 Day(Gün) olarak sonuç değerini tutar.
<SetVariable Name="$(Result)">
<DateTimeDifference Part="Day">
<Value Target="Date">::/Production/User[1]/@LastLogin</Value>
<Value Target="Date">::/Production/User[2]/@LastLogin</Value>
</DateTimeDifference>
</SetVariable>
$(Result) sayı 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 Month(Ay) olarak sonuç değerini tutar.
<SetVariable Name="$(Result)">
<DateTimeDifference Part="Month">
<Value Target="Date">::/Production/User[1]/@LastLogin</Value>
<Value Target="Date">::/Production/User[2]/@LastLogin</Value>
</DateTimeDifference>
</SetVariable>