I have a validFrom and validTo date field in my domain class in a grails project. I want to create a service based on its verification. can someone tell me how to check if it is more or less than the current system date?
it
Date now = new Date() if (validFrom.before(now) && validTo.after(now)) { //valid for this moment }
Source: https://habr.com/ru/post/1411794/More articles:Get parent directories of a file, down to the point - pythonAny optimized way to encrypt and decrypt a file inside Android - javaInfinitest with Eclipse 4 (Juno) - javaF suffix for the number assigned to the double - c ++How to convert comma separated string to array of row cells in matlab - matlabIs there a way to embed a terminal window in TextMate? - shellWatin timeout when using SignalR - signalrHow can I refer to a closure using a string in the same way as is done using a member function without using eval? - javascript.Doc Files Not Included in ASP.NET Publish - asp.net-mvc-3Using tf.exe to get code for different workspaces - tfsAll Articles