Get weekend timestamp in python
<p>I have to convert get weekend timestamp from php to python. I google many times but couldn't find the answer.
in php I can do</p>

<pre><code>endOfWeek = strtotime('next saturday, 11:59:59pm America/Los_Angeles');
</code></pre>

<p>Do you guys know how to do the thing like that in python pls help me out</p>

<p>You can use the <a href="https://dateutil.readthedocs.io/en/stable/" rel="nofollow">dateutil</a> package. </p>

<pre><code>from dateutil.relativedelta import *
from datetime import *
from dateutil.tz import *
today = datetime.now(tzutc())
new_time = today+relativedelta(weekday=FR, hours=11, minutes=59, seconds=00)
new_time = new_time.astimezone(gettz("America/Los Angeles"))
print(new_time)
</code></pre>

<h3>Output:</h3>

<blockquote>
  <p>2016-09-02 02:19:21.899007-05:00</p>
</blockquote>

python timestamp