What do you want to save?
Add Code snippet
New code examples
-
Shell/Bash 2022-02-11 16:55:02
discord.py bot github
#Discord.py bot github import discord from discord.ext import commands import datetime from urllib import parse, request import re bot = commands.Bot(command_prefix='>', description="This is a Helper Bot") @bot.command() async def ping(ct... Add solution -
Python 2021-11-17 04:29:13
convert timezone python
from datetime import datetime from pytz import timezone, all_timezones # must read else Bug: # https://blog.ganssle.io/articles/2018/03/pytz-fastest-footgun.html # aware dt-obj dt_obj = datetime.strptime('2021-05-19T01:55:10+0000', '%Y-%m-%dT%H:%M:%S%z')... Add solution -
Python 2021-09-30 23:04:03
utc to local time python
# here are a few ways to convert time zone from datetime import datetime from dateutil import tz # METHOD 1: Hardcode zones: from_zone = tz.gettz('UTC') to_zone = tz.gettz('America/New_York') # METHOD 2: Auto-detect zones: from_zone = tz.tzutc() to_zone... Add solution