Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.041 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'url:pypi': 0.03; 'receives': 0.04; 'jan': 0.12; 'bashir': 0.16; 'offsets': 0.16; 'readable': 0.16; 'subject: \n ': 0.16; 'subject:Convert': 0.16; 'subject:format': 0.16; 'timestamp': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'format,': 0.24; 'sends': 0.24; 'header:In-Reply-To:1': 0.27; 'specifically': 0.29; 'correct': 0.29; 'appreciated.': 0.29; 'code': 0.31; 'stuff': 0.32; 'url:python': 0.33; 'subject:time': 0.33; 'maybe': 0.34; 'subject:from': 0.34; 'convert': 0.35; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'should': 0.36; 'implement': 0.38; 'server': 0.38; 'to:addr:python-list': 0.38; 'explain': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; 'received:unknown': 0.61; 'you.': 0.62; 'interest': 0.64; 'received:109': 0.72; 'yourself': 0.78; 'you:': 0.81; 'everyone;': 0.84; 'received:(helo localhost)': 0.91 Date: Thu, 30 Jan 2014 16:03:30 +0100 From: Johannes Findeisen To: python-list@python.org Subject: Re: Convert NTP timestamp from NTP packet to System time and date format In-Reply-To: References: X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.22; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391094775 news.xs4all.nl 2885 [2001:888:2000:d::a6]:59358 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65019 On Thu, 30 Jan 2014 18:34:04 +0500 Sadia Bashir wrote: > Hello everyone; > > I want to write NTP client which sends and receives NTP packet to NTP > server and should read the value from one of the four offsets and convert > it to user readable local or GMT time format, I specifically want to know > which offsets should I read in order to get correct timestamp from the > packet. > Any suggestion or help will be appreciated. Maybe this lib is of interest to you: https://pypi.python.org/pypi/ntplib/ It does all the NTP stuff for you. If you want to implement that stuff by yourself just take a look at the code of ntplib, it should explain what you want. Regards, Johannes