Author Topic: parsing event_time into time  (Read 2367 times)

Tags:
  • All members
  • Posts: 314
parsing event_time into time
« on: 05 Apr 2017, 12:28 »
Hi,

As for the subject header, if I look at event_start, I am given a double number representing a time...

Is it possible to parse this value into an actual start time given by HH:mm

its easy to do it in C#, but this is not C#... DateTime.FromOADate(time).ToString("HH:mm");

Or, maybe is there a simple variable that I can look at the give me that?

Thanks

Mark.

  • All members
  • Posts: 314
Re: parsing event_time into time
« Reply #1 on: 05 Apr 2017, 14:08 »
OK, here is what I used to give me what I want, but its very verbose, so to speak, and am hoping there is a nicer alternative...

IF(INTEGER((event_start - now_time) / mf_hour) < 10, 0,)INTEGER((event_start - now_time) / mf_hour):IF(INTEGER((event_start - now_time) / mf_minute) < 10, 0,)   INTEGER((event_start - now_time) / mf_minute) - 60*INTEGER((event_start - now_time) / mf_hour)

Mark.

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: parsing event_time into time
« Reply #2 on: 06 Apr 2017, 19:22 »
This date and time is stored in Excel format. So if you will later export it to Excel, you do not have to do anything with it, just right-click on the cell, choose "Format Cells" and select "Time". Or is it for a different purpose?
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • All members
  • Posts: 314
Re: parsing event_time into time
« Reply #3 on: 09 Apr 2017, 13:26 »
Hi Oxa,

Thanks for the response. My needs are a little more complicated. Yes, I know that the datetime variables are given to us in double format, and can be translated through excel...

But, for my needs, I developed a trigger for a friend, and it employs a strategy which places a lay bet on the correct score, during half time.. After much discussion, I decided to use a simple condition which was selection's minutes since the off is between 55 and 60 minutes, which pretty much guarantees that its at half time...

The problem came when I tried to demonstrate the triggers use, and I brought up a match that had only just reached half time, at approx 47 minutes after kick off... At the 55th minute, or very soon after, I expected the trigger to fire, because minutes after the off would be at 55...

No luck with that, no bet placed, and so, my need was to be able to parse the event_start into a time, so that, no matter when I opened MFP, be that 20 minutes into the match or anytime before half time, my trigger will execute the lay before the start of the second half...

So, my need was to be able to look at checking the difference between event_start, and NOW, giving me the minutes value, so I could use a variable say called maoTime, and then use a condition to say where trigger expression maoTime is between 55 and 60....

But, of course I wasn't able to do this...

It would not have been needed if MFP knew how many minutes had passed since kick off, even though MFP was not open before kick off...

Mark.

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: parsing event_time into time
« Reply #4 on: 09 Apr 2017, 17:05 »
To check the difference between now and event start, just use the following expression:

For the difference in seconds:

(now_time - event_start)/mf_second

For the difference in minutes:

(now_time - event_start)/mf_minute
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • All members
  • Posts: 314
Re: parsing event_time into time
« Reply #5 on: 09 Apr 2017, 20:12 »
Hi Oxa,

Thanks for the reply...

That doesnt actually work...

I actually set it as a user variable, and the match had not started at the SCHEDULED time, but using  (now_time - event_start)/mf_minute, the minutes started to count up once time had gone past the scheduled time...

Looking to change this to event_off - I can see that this wont work either, if I decide to open MFP and load a match in the first half of play, then the value returned will only be set once I added the market..

So, I am not sure how my issue can be resolved here

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: parsing event_time into time
« Reply #6 on: 18 Apr 2017, 12:30 »
I guess you can try somehow combining that and the match_minute value in the markets where the score is available (i.e. match_minute is equal to 45 for a long time = half time).
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • All members
  • Posts: 314
Re: parsing event_time into time
« Reply #7 on: 16 Jun 2017, 11:26 »
Hi,

Thanks for the help on this topic.

I now have a similar problem, which I am hoping to get some help on...

I have written a trigger that will write the matches into a csv file, simple enough process, but I also want to attach the time to the file.

My trigger uses
write to file
Text ["market_name"] File path c:\.......x.csv

I would like to be able to write ["match_time"]["market_name"]

I cannot find any variable which shows the match time, or the actual event start in dd/MM/yyy HH:mm format, or even simply HH:mm format.

I have worked out how to get how many hours and minutes it is until the scheduled start, but, I have no idea how to get the time right now, add minutes, and parse it into HH:mm.

Does this exist?

Thanks

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: parsing event_time into time
« Reply #8 on: 17 Jun 2017, 10:45 »
Hello!

There is currently no way to transform the Excel-formatted date into normal text notation, but I have seen this request many times, so I have scheduled this feature for the next release.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

 

Please note, BetFair is seems to be currently OFFLINE