파이썬에서 특정 시간에 대응하는 datetime 객체 생성

파이썬에서 특정 시간에 대한 datetime 객체를 만드는 방법입니다. 예를 들어 2022년 9월 27일 19시 30분 20초를 datetime 객체로 생성하려면 아래와 같이 할 수 있습니다.

import datetime

dt = datetime.datetime(2022,9,27,19,30,20)

이렇게 만든 객체에는 시간대(timezone) 정보가 없습니다. 만약 이 시간이 한국 시간(GMT+9)이라면 아래와 같이 시간대 정보를 추가할 수 있겠습니다.

import pytz

tz_info = pytz.timezone('Asia/Seoul')
dt_loal = dt.astimezone(tz_info)

@joviansummer의 스팀 프로젝트

스팀 증인노드를 운영중입니다. @jswit에 증인투표해 주시면 감사하겠습니다.
(https://steemitwallet.com/~witnesses)

jswit 증인 노드 프로젝트를 시작합니다.

jsup 업보팅(upvoting) 서비스 소개

jsup 수혜자 지정 기능 추가

jsup 서비스에 큐레이션 보상 분배 기능이 추가되었습니다.

jSTEEM 프로젝트 - 텔레그램 챗봇으로 구현하는 스팀 블럭체인 탐색기

STEEM.NFT - 디지털 아트 보존 프로젝트

Posted through the AVLE Dapp (https://avle.io)

Sort:  

Hello friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)

Upvoted! Thank you for supporting witness @jswit.

Coin Marketplace

STEEM 0.13
TRX 0.35
JST 0.035
BTC 116035.38
ETH 4499.69
SBD 0.86