Skip to content

Instantly share code, notes, and snippets.

@mrtushartiwari
Created March 10, 2023 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrtushartiwari/859bfaf779e8de474e9b155c67ef91de to your computer and use it in GitHub Desktop.
Save mrtushartiwari/859bfaf779e8de474e9b155c67ef91de to your computer and use it in GitHub Desktop.
import pandas as pd
from datetime import datetime
df = pd.DataFrame([1678448391,1678448399,1678448400,1678448500,1678448900],columns =[ 'time'])
df['time'] = pd.to_datetime(df['time'],unit='s', utc= True)
df['time'] = pd.to_datetime(pd.to_datetime(df['time'],unit='s'),utc = True)
df['time'].dt.tz_convert('Asia/Kolkata')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment