|
Attention! Read the forum rules carefully before posting a topic.
Try to find an answer in Wiki before asking a question. Submit programming questions in this forum only. Off topics are strictly forbidden.
Any topics which do not satisfy these rules will be deleted.
compare hours and minutes fundamental new |
jaime_1008
|
Post subject: compare hours and minutes fundamental new |
Post rating: 0
|
Posted: Tue 27 Aug, 2013, 14:19
|
|
User rating: 1
Joined: Sun 18 Dec, 2011, 04:05 Posts: 36 Location: Spain, Madrid
|
Hi,
i would like to check the hour and time of economic news, for example, if there is a economic news at 13:00 but in Jforex relase at 13:10, i want to detect that, economic news is on time or not.
Can you help?, pls.
Best Regards
|
|
|
|
 |
API Support
|
Post subject: Re: compare hours and minutes fundamental new |
Post rating: 0
|
Posted: Tue 27 Aug, 2013, 14:30
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
 |
jaime_1008
|
Post subject: Re: compare hours and minutes fundamental new |
Post rating: 0
|
Posted: Tue 27 Aug, 2013, 15:09
|
|
User rating: 1
Joined: Sun 18 Dec, 2011, 04:05 Posts: 36 Location: Spain, Madrid
|
Thanks... But i don't know how to compare dates and time. sorry, my programmer level is medium/low  . can you help me? the target is to get the date, hour and minute of the economic news and compare to local jforex time....if it is at the same day, hour and minute it's OK!! Best regards
|
|
|
|
 |
API Support
|
Post subject: Re: compare hours and minutes fundamental new |
Post rating: 0
|
Posted: Tue 27 Aug, 2013, 15:16
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
You compare the dates just like numbers, as they are given in milliseconds and represented by the long primitive data type. If you encounter any problems please post your example strategy and pin point what you don't know how to implement.
|
|
|
|
 |
jaime_1008
|
Post subject: Re: compare hours and minutes fundamental new |
Post rating: 0
|
Posted: Tue 27 Aug, 2013, 15:22
|
|
User rating: 1
Joined: Sun 18 Dec, 2011, 04:05 Posts: 36 Location: Spain, Madrid
|
} } else { calendarNews = (ICalendarMessage) message; List<ICalendarMessage.Detail> calendarNewsDetails = calendarNews.getDetails(); ----> here. COMPARE IF THE ECONOMIC NEWS IS DELAY OR NOT
for (Detail newsDetail : calendarNewsDetails) {
......
|
|
|
|
 |
API Support
|
Post subject: Re: compare hours and minutes fundamental new |
Post rating: 1
|
Posted: Tue 27 Aug, 2013, 15:36
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
jaime_1008 wrote: the target is to get the date, hour and minute of the economic news and compare to local jforex time You need to compare ICalendarMessage.getEventDate() with System.currentTimeMillis()jaime_1008 wrote: if it is at the same day, hour and minute it's OK!! It is easier to check if there is, for example no more than 60 seconds between the two dates, i.e.: boolean spanLessThanMinute = Math.abs(calendarNews.getEventDate() - System.currentTimeMillis()) < TimeUnit.SECONDS.toMillis(60);
|
|
|
|
 |
jaime_1008
|
Post subject: Re: compare hours and minutes fundamental new |
Post rating: 0
|
Posted: Tue 27 Aug, 2013, 15:55
|
|
User rating: 1
Joined: Sun 18 Dec, 2011, 04:05 Posts: 36 Location: Spain, Madrid
|
THANK YOU VERY MUCH...
i will test it and tell something here....
Last thing and very different, why sometimes i see in the forum code like (please find attached)
Best regards
Attachments: |
Screen Shot 2013-08-27 at 15.57.06.png [42.92 KiB]
Downloaded 386 times
|
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on
this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control
on their content. Anyone accessing this webpage and downloading or otherwise making use of any document,
data or information found on this webpage shall do it on his/her own risks without any recourse against
Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from
the use and/or reliance on any document, data or information found on this webpage.
|
|
|
|
|
 |
API Support
|
Post subject: Re: compare hours and minutes fundamental new |
Post rating: 0
|
Posted: Tue 27 Aug, 2013, 16:06
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
jaime_1008 wrote: Last thing and very different, why sometimes i see in the forum code like (please find attached) remove the hilit argument from the url and reload the page to make it disappear.
|
|
|
|
 |
tcsabina
|
Post subject: Re: compare hours and minutes fundamental new |
Post rating: 1
|
Posted: Tue 27 Aug, 2013, 20:10
|
|
User rating: 164
Joined: Mon 08 Oct, 2012, 10:35 Posts: 676 Location: NetherlandsNetherlands
|
I think what jaime_1008 asked is how is it possible that in a forum post a code snippet is formatted, just like on the picture that was attached. If this is indeed the question, you can use the code tags to make your comment formatted. Start with [code*] and finish with [/code*], like this: public int test(void) { return 0; }
You should remove the * from the tags. I just placed it there so you can see the actual tag. I attached a screenshot that was taken while the post was open, so you can see what I am talking about.  If this is not what you have asked, I am sorry to explain something boring  .
Attachments: |
File comment: Screenshot to show the post tags.
Capture.PNG [31.41 KiB]
Downloaded 537 times
|
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on
this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control
on their content. Anyone accessing this webpage and downloading or otherwise making use of any document,
data or information found on this webpage shall do it on his/her own risks without any recourse against
Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from
the use and/or reliance on any document, data or information found on this webpage.
|
|
|
|
|
 |
jaime_1008
|
Post subject: Re: compare hours and minutes fundamental new |
Post rating: 0
|
Posted: Tue 27 Aug, 2013, 21:16
|
|
User rating: 1
Joined: Sun 18 Dec, 2011, 04:05 Posts: 36 Location: Spain, Madrid
|
Also thanks!!! tcsabina wrote: I think what jaime_1008 asked is how is it possible that in a forum post a code snippet is formatted, just like on the picture that was attached. If this is indeed the question, you can use the code tags to make your comment formatted. Start with [code*] and finish with [/code*], like this: public int test(void) { return 0; }
You should remove the * from the tags. I just placed it there so you can see the actual tag. I attached a screenshot that was taken while the post was open, so you can see what I am talking about.  If this is not what you have asked, I am sorry to explain something boring  .
|
|
|
|
 |
jaime_1008
|
Post subject: Re: compare hours and minutes fundamental new |
Post rating: 0
|
Posted: Wed 28 Aug, 2013, 13:10
|
|
User rating: 1
Joined: Sun 18 Dec, 2011, 04:05 Posts: 36 Location: Spain, Madrid
|
WORKS NICE the comparation of time.
Thanks
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|