The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

ISO Datetimes With Timezones In Python

TODO: Pull subtitle into page object code_start_default_section code_end_default_section

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

ISO Datetimes With Timezones In Python

-- code/
-- python

import pytz

from dateutil.parser import isoparse

def make_eastern_time(*, input):
    naive_datetime = isoparse(input)
    nyc_timezone = pytz.timezone("America/New_York")
    nyc_aware_datetime = nyc_timezone.localize(naive_datetime)
    iso_formatted_string = nyc_aware_datetime.isoformat('T', 'seconds')
    return iso_formatted_string
# Example: Eastern Daylight Time
# >>>>>>>>>>>>>>>>>>>>> OUTPUT 2020-07-15T12:30:00-04:00

# Example: Eastern Standard Time
# >>>>>>>>>>>>>>>>>>>>> OUTPUT 2020-11-15T12:30:00-05:00

-- /code

-- categories
-- Python

-- metadata
-- date: 2020-11-12 00:00:00
-- id: 20envn9v
-- status: draft
-- type: post
-- SCRUBBED_NEO: false
-- site: aws