How to get rid of reminder time issue in slack? - time

I am currently using slack, it’s a great team work tool. I have one issue though: when I create a remind say, /remind me “abc” at night, it sets the reminding time as 3pm. but this is not night, i would like to have 6pm, or better I can set it myself (i.e., set tonight as 6pm). How can I achieve this? - btw, i live in US west coast

You can use the time itself or a relative time:
/remind me "abc" at 6pm CST
/remind me "123" tomorrow night at 8pm CST
/remind me "youandme" 5 hours from now
You can also set your timezone data by exploring the /tz command
You can set it on the account level by following the instructions here.

Related

Yahoo Finance - Historical Intraday Download

does anybody know why the code below does not bring data after 16:55hr? The market actually closes at 18:00 in Brazil. This happens for all tickers ending in ".SA" in Yahoo Finance.
import yfinance as yf
data = yf.download("PETR4.SA", group_by="Ticker", period='1mo', interval='5m',prepost = True)
data['ticker'] = "PETR4.SA"
data
Thanks!
This is kind of an interesting question. I checked the code. I've been working with several providers, including Yahoo Finance, and I believe it could be more a "pre definition" on the API than a programming/requisition mistake.
As the stock negotiations at B3 normally take place until 17:00 pm (-3 UTC, São Paulo Timezone), the function is returning the last valid computed value i.e. 16:55 pm.
As an exercise I tried to change the time in-between the data from "5m" to "2m" and I spotted the last value at 16:58 pm (same logic). I don't know how to bypass that.
It appears to be the way it works.

Betfair API output time zone off sometimes

I am laying bets through the Betfair API and noticed something very strange. For some events the time is off on both market and event results.
My account date and time are set to Europe/London. Not that it matters, the API outputs whatever zone it wants anyway, apparently at random (sometimes GMT other times London or whatever other timezone, but the ISO timestamp does not include +0100 or whatever GMT offset), all this despite the fact that my account is set to EU/London.
For example let's take this event Superettan / Jonkopings Sodra v Varnamo
The API output is:
{"event"=>{"id"=>"28836884",
"name"=>"Jonkopings Sodra v Varnamo", "countryCode"=>"SE",
"timezone"=>"GMT", "openDate"=>"2018-08-13T18:00:00.000Z"
}, "marketCount"=>2}
Their website however says the event starts at 17:00 GMT / 18:00 London (now GMT+1).
There are hundreds examples like this. Cannot get anything out of Betfair support, they take days/weeks to reply and when they do they just send some canned message.
Has someone seen this issue before? Or perhaps I am missing something?
Later edit: I had to dump all their market data to reach this conclusion: it appears that when their API says the timezone is GMT the event is actually on London, so GMT+1 right now, and for every other timezone (Eu/London, Perth, US...) the time is actually on GMT. Not sure what's up with that. Still investigating.
All times returned by Betfair are in UTC - that's just the way the API works. They also supply time zones which may or may not be correct. Use the time zones as an indication of the local time of the event. However, the time zones are very "hit and miss", so don't rely on them to be correct. In fact, over time you will notice lots of "data errors" for non-pricing info on Betfair markets. This is just the way it goes. so don't expect them to fix the errors
Event.openDate is documented as "The scheduled start date and time of the event. This is Europe/London (GMT) by default" while Event.timezone is defined as "[the] timezone in which the event is taking place."
So, in one sense, the openDate in your API output is correct because it says 18:00. However, it's incorrect because it includes the Zulu 'Z' suffix indicating GMT / UTC. The inclusion of 'GMT' in the timezone field: a) is wrong; and b) just serves to confuse matters, IMHO.
Instead, I've started to use MarketCatalogue.marketStartTime which is defined as "The time this market starts at..." which isn't quite the same as openDate but, if they're going to be different, usually on Betfair you're more interested in when the market goes in-play than when the actual match / race / game begins.
The Events I'm using to validate this approach seem to work better this way. Bearing in mind that the UK moves from BST on 27 October to GMT on 28 October, from the API I'm receiving these as MarketCatalogue.marketStartTime:
Liverpool v Cardiff: "2018-10-27T14:00:00.000Z" [Correct: 14:00 GMT is 15:00 BST]
F1 Mexico Grand Prix [qualifying]: "2018-10-27T18:00:00.000Z" [Correct: 18:00 BST is 19:00 GMT]
Burnley v Chelsea: "2018-10-28T13:30:00.000Z" [Correct: 13:30 GMT is 13:30 GMT]

How do I get slack to remind me every fortnight from next Saturday

Slack has the /remind command that allows you to set a reminder in a channel. I am trying to have slack remind me every fortnight starting from next Saturday at 8pm to jump on a call. It seems like an extension of the help documentation.
I tried:
/remind #here Fortnightly planning and retro every fortnight from saturday at 8pm
but it didn't work and the reminder states:
I will remind space-racing “planning and retro every fortnight from saturday at 8pm” at 9AM every other Saturday (next occurrence is April 22nd).
Any thoughts? thanks in advance
I was trying to do this today also. Either of these options work:
Needs to be run the week before you want it to start:
/remind me to "ABC" every other Saturday 8pm
/remind me to "ABC" Saturday 8pm every 2 weeks
Otherwise specify the start date
/remind me to "ABC" Jun 19th 8pm every 2 weeks
/remind me to "ABC" next Saturday 8pm every 2 weeks
Slackbot told me:
I will remind you to “ABC” at 8PM every other Saturday (next occurrence is June 19th).
Only achievable when setting a reminder <7 days when the first occurrence should happen. For example if you want to set the reminder at Saturday May 9th at 8pm, the earliest you can set the reminder is Saturday May 2nd 8:01pm
Then you run a command like so:
/remind #my-channel #my-group-to-notify This is my reminder message at 8pm every other Saturday
You can skip the channel or group of course. But it's nice if you run some team ceremonies and want to set reminder to specific people to attend a meeting etc.
Hint: you always set the time as per your current timezone, if other people are in different time zone the reminder will be at their time, so you don't need to worry that 8pm might be for them later/earlier. You all will see reminder in the same moment.
You can specify the starting date by the keyword starting at the end.
/remind #my-channel #my-group-to-notify This is my reminder message at 8pm every other Saturday starting April 29nd
But you need to set this. they week before you want to get notified.
For e.g Today is 7th September 2018 ( Friday) and you want to get notified on 21st September 2018 ( Friday ) i.e second Friday after today ( Friday ).
you need to use this command on next Friday. ie. on 14th September 2018 , use this command and slack will start reminding you after every other( second ) friday.
Example Command on SlackBot :
/remind me to "Send : Time Sheet" every other Friday 11am

How to get user hour of the week in Ruby

I want to get the current hour of the week in which day starts from Sunday.
Consider current time is
Time.now
=> 2014-10-29 12:09:23PM +0530
The result should be : 84
Explanation:
Sunday - 24 hours
Monday - 24 hours
Tuesday - 24hours
Wednesday - 12 hours
Total: 84
How can get the user hour of the week. Is there any method available in Ruby ? Or how to do it without Ruby method.
You can get the day of the week and hour of the day using Time#wday and Time#hour.
Time.now.wday
#=> 3
Time.now.hour
#=> 14
The rest is basic mathematics.
Even though I upvoted Yu Hao, I must say it's not a good approach if you want to pay attention to the concerns Jon Skeet raised. To that end, here's another approach:
(Time.now - (Date.today - Date.today.wday).to_time) / 3600
Date.today is, well, today. If you subtract the number of days since the week started, you get Sunday. Convert it to Time and it's the midnight when Sunday began. Subtraction gives you number of seconds between then and now. Divide by 3600 (and optionally round) to get number of hours. The DST details should be transparently handled by Time#-.
EDIT: Timezones... Run this before:
ENV['TZ']='EST5EDT'
(be sure to reset it back to what it used to be afterwards, in case anyone else needs to know time and didn't count on you switching timezones.) You can also use "America/New_York" instead. See tz list for details.

Heroku Scheduler timezone?

What's the Heroku timezone for Scheduler? It says "UTC" but I'm not sure if that's correct. My tasks are starting at the wrong time despite converting the timezone correctly.
Thoughts?
This question's a bit old, but yes, Heroku Scheduler definitely uses UTC even if you specify a timezone in your app. I tested it with this code:
task :send_test_email => :environment do
if Date.today.strftime("%A").downcase == 'monday'
UserMailer.send_test_email(Time.now.strftime("%Z")).deliver
end
end
I'm in Pacific time zone. I set Heroku Scheduler to run this every 10 minutes, and this email was able to send on Sunday night PST, which is Monday in UTC time. Also, the string I passed to the mailer,Time.now.strftime("%Z"), is set as the subject of the email which indeed read, "UTC"
One potential source of confusion is Daylight Saving Time. For example, UTC is always 8 hours ahead of Pacific Standard Time (PST - used for winter months), and 7 hours ahead of Pacific Daylight Time (PDT - used for summer months). So if your tasks are off by an hour, it could be you measured from the wrong UTC zone.

Resources