この会話は、活動がないためロックされています。新しい投稿を作成してください。
この会話は、活動がないためロックされています。新しい投稿を作成してください。
My requirement is that my scheduled service will run at every 60 mins. I have done that.
Now I want to be able to find the assets created in last 60 minutes, I was writing a query for the same.So i created
DateTime dt = new DateTime();
DateTime modified_last_run_date = dt.minusMinutes(60);
DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
String last_run_time =modified_last_run_date.toString(dtf);
if I print the last_run_time string to console I get -- "2015-08-19T17:38:36.221+0530"
However when I write Query : SELECT p.* FROM [dam:Asset] AS p WHERE p.[jcr:created] >= CAST('2015-08-19T17:38:36.221+0530' AS DATE) I get java.lang.IllegalArgumentException: Not a date string: 2015-08-19T17:38:36.221+0530
but if I write SELECT p.* FROM [dam:Asset] AS p WHERE p.[jcr:created] >= CAST('2015-08-19T17:38:36.221Z' AS DATE) I get no compilation error and query runs but with a lag of 5:30 hrs i mean i don't get correct results.
Can anybody suggest me solution.
In brief I want to find in each hourly run of my service which were the assets created since last run.
解決済! 解決策の投稿を見る。
表示
返信
いいね!の合計
as @siva mentioned, you need ':' to add in your time and your query should fetch you a result. You quickly try your query in 'tools -> query' in crxde
[img]Capture.JPG[/img]
表示
返信
いいね!の合計
Did you try this SELECT p.* FROM [dam:Asset] AS p WHERE p.[jcr:created] >= CAST('2015-08-19T17:38:36.221+05:30' AS DATE)
表示
返信
いいね!の合計
Try using the QueryBuilder API to perform this task - look at this older community thread - Justin give some advice
表示
返信
いいね!の合計
as @siva mentioned, you need ':' to add in your time and your query should fetch you a result. You quickly try your query in 'tools -> query' in crxde
[img]Capture.JPG[/img]
表示
返信
いいね!の合計
To fix this, update your pattern string to "yyyy-MM-dd'T'HH:mm:ss.SSSXXX".
表示
返信
いいね!の合計
and to get ':' use this format yyyy-MM-dd'T'HH:mm:ss.SSSZZ
表示
返信
いいね!の合計