groovy - Get all records by date ignoring the time in DateTime in grails -


i'm using grails joda date time plugin want fetch record day ignoring time precision in date. whats best way it?

thanks help.

class record {   datetime datefield    def getallrecordsforoneday(aday = new datetime()) {      def localdate = new localdate(aday);      record.findalldatefieldbetween(localdate.todatetimeatstartofday(), localdate.plusdays(1).todatetimeatstartofday())      //or criteria      record.withcriteria {        between 'datefield', localdate.todatetimeatstartofday(), localdate.plusdays(1).todatetimeatstartofday()      }    }  } 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -