date/time in groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

date/time in groovy

Pierre Smits
Hi all,

In a .groovy file I want to capture from a query-string a date-time string
for the start of a period ( &psd=2010-09-01 09:14:00.000) and a date-time
string for the end of a period (&ped=2010-09-06 10:46:13.000).

In the .groovy file I have following code:

periodStartDate = parameters.psd;
tmpPSD =
UtilDateTime.getDayStart(UtilDateTime.toTimestamp(periodStartDate));

periodEndDate = parameters.ped;
tmpPED = UtilDateTime.getDayEnd(UtilDateTime.toTimestamp(periodEndDate));

But when I look at the result of both tmpPSD and tmpPED I don't get the
expected DayStart value for tmpPSD or DayEnd value for tmpPED, but the
DayStart and DayEnd values for today....

How can I resolve this?

Regards,

Pierre
Reply | Threaded
Open this post in threaded view
|

Re: date/time in groovy

Scott Gray-2
Hi Pierre,

Sounds like getDayStart() is being passed a null argument.  Either parameters.psd is returning null or toTimestamp() is.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 6/09/2010, at 8:55 PM, Pierre Smits wrote:

> Hi all,
>
> In a .groovy file I want to capture from a query-string a date-time string
> for the start of a period ( &psd=2010-09-01 09:14:00.000) and a date-time
> string for the end of a period (&ped=2010-09-06 10:46:13.000).
>
> In the .groovy file I have following code:
>
> periodStartDate = parameters.psd;
> tmpPSD =
> UtilDateTime.getDayStart(UtilDateTime.toTimestamp(periodStartDate));
>
> periodEndDate = parameters.ped;
> tmpPED = UtilDateTime.getDayEnd(UtilDateTime.toTimestamp(periodEndDate));
>
> But when I look at the result of both tmpPSD and tmpPED I don't get the
> expected DayStart value for tmpPSD or DayEnd value for tmpPED, but the
> DayStart and DayEnd values for today....
>
> How can I resolve this?
>
> Regards,
>
> Pierre


smime.p7s (3K) Download Attachment