21 EKİM 2009, ÇARŞAMBA
Nasıl bir DateTime Bugün ortaya çıkarsa kontrol etmek için?
Bir daha iyisi vardır .net bir şekilde eğer bir DateTime oluştu olmadığını kontrol etmek için 'bugün' aşağıdaki kodu?
if ( newsStory.WhenAdded.Day == DateTime.Now.Day &&
newsStory.WhenAdded.Month == DateTime.Now.Month &&
newsStory.WhenAdded.Year == DateTime.Now.Year )
{
// Story happened today
}
else
{
// Story didn't happen today
}
CEVAP
21 EKİM 2009, ÇARŞAMBA
if (newsStory.WhenAdded.Date == DateTime.Today)
{
}
else
{
}
Hile yapmak gerekir.
Bunu Paylaş:
DateTime.Eğer bir tarih 30 günden daha...
Bir dize kontrol etmek için nasıl &quo...
Nasıl iPhone SDK üzerinde etkin bir İn...
Nasıl Server tablo sütun olup olmadığı...
Nasıl kontrol etmek için iOS sürümü?...