I actually found the solution by looking at the source code. I do this:

Integer now = new Integer( (int) new Date().getTime()/1000);

and everything works.

But is there on "official" way to do it? and what is the meaning of the
"playtime" field? it is meant to be used with DateSupport ? is there an
easier way to check if an instance of mmevents is expired?

thank you

piero de salvia wrote:

> hello,
>
> I am trying to test against the start and stop date of a time builder,
> which is of type mmevent.
>
> I saw that start and stop are saved as integers.
>
> So i do :
>
> // get today's date in milliseconds
>
> Long  now = new Long(new Date().getTime());
>
> and then I check the value of my time builder like this :
>
> <mm:relatednodes type="mmevents">
>     <mm:field name="stop" id="aStop" write="false" />
>     <mm:write referid="aStop" jspvar="runningStop" vartype="Long" >
>     <%
>      if ( now.compareTo(runningStop) <= 0 )
>       endOK = true;
>     %>
>     </mm:write>
> </mm:relatednodes>
>
> but even if "stop" is set in the future, this never works, because the
> value that i get back from mmbase for "stop" is always smaller than
> today's value.
>
> how does mmbase store dates in this case?
>
> thank you
>
> piero de salvia


Reply via email to