0
arrow.get(datetime.now(), 'Asia/Shanghai').date()

Returns datetime.date(2017, 3, 26) but it is 27th March there. How do I fix this?

mtrw
  • 34,200
  • 7
  • 63
  • 71
user308827
  • 21,227
  • 87
  • 254
  • 417

1 Answers1

1

Documentation gives example over starting with utc then applying the timezone. For your case:

import arrow
utc = arrow.utcnow()
utc.to('Asia/Shanghai').date()

should give you the local date you are looking for.

hurturk
  • 5,214
  • 24
  • 41