Bug in templates? - Date handling

Bug in templates? - Date handling

Old forum URL: forums.lhotka.net/forums/t/1770.aspx


sune42 posted on Wednesday, November 15, 2006

Hi

Toaday in the templates all SmartDate (DateTime) objectecs are
initialized like

        private SmartDate _lastVisit = new SmartDate(DateTime.Today);

The problem is that Today does not provide any time information, so entires
in the DB gets a bit wrong as there's no time information provided if I do not
set it by my self.

Would it not be better /consistent to change that to DateTime.Now instead?

//Andy

rasupit replied on Tuesday, November 21, 2006

Andy,
code generater will never accurately predict how will you use datetime property therefore choosing Now over Today won't be any better either, since there is time that you're only interested in date not time.

You can use the dataportal_create to initialize default values
Ricky

Copyright (c) Marimer LLC