1

I set a date to midnight like this:

user_tz = timezone('America/Los_Angeles')
day_start = user_tz.localize(entered_at.replace(hour=00, minute=00))

I print the date and it looks like so:

start date: 2014-08-21 00:00:00-07:00

What is the -7:00 at the end and how do I make it go away?

Atma
  • 29,141
  • 56
  • 198
  • 299
  • -7:00 is the offset of the your local Pacific timezone relative to UTC -- it's 7 hours behind. – kchan Aug 26 '14 at 00:23

1 Answers1

2

Your question is answered by this part of the Django documentation. In short, it's the UTC offset: the time difference between the timezone you have selected and UTC.

To "make it go away", convert the aware datetime to a naive datetime, or set user_tz to the UTC timezone.

Newb
  • 2,810
  • 3
  • 21
  • 35