cyberjunky / python-garminconnect

Python 3 API wrapper for Garmin Connect to get activity statistics
MIT License
965 stars 151 forks source link

added method: add_weigh_in_with_timestamps() #229

Closed linuxlurak closed 2 weeks ago

linuxlurak commented 1 month ago

Use it like this:

local_timestamp = weigh_in_date.strftime('%Y-%m-%dT%H:%M:%S') gmt_timestamp = weigh_in_date.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%S')

client.add_weigh_in_with_timestamps( weight=weight, unitKey=unit, dateTimestamp=local_timestamp, gmtTimestamp=gmt_timestamp )

needs: from datetime import datetime, timezone

cyberjunky commented 2 weeks ago

Thank you @linuxlurak !