From owner-freebsd-questions@FreeBSD.ORG Fri Oct 6 18:44:31 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 000E216A4C8 for ; Fri, 6 Oct 2006 18:44:30 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F87E43D6B for ; Fri, 6 Oct 2006 18:44:30 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from mac.com (smtpin07-en2 [10.13.10.152]) by smtpout.mac.com (Xserve/8.12.11/smtpout11/MantshX 4.0) with ESMTP id k96IdeV9012183; Fri, 6 Oct 2006 11:39:41 -0700 (PDT) Received: from [17.214.13.96] (a17-214-13-96.apple.com [17.214.13.96]) (authenticated bits=0) by mac.com (Xserve/smtpin07/MantshX 4.0) with ESMTP id k96IdcJ6006507; Fri, 6 Oct 2006 11:39:39 -0700 (PDT) In-Reply-To: <200610061821.k96ILWHA008725@dc.cis.okstate.edu> References: <200610061821.k96ILWHA008725@dc.cis.okstate.edu> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Chuck Swiger Date: Fri, 6 Oct 2006 11:39:37 -0700 To: Martin McCormick X-Mailer: Apple Mail (2.752.2) X-Brightmail-Tracker: AAAAAA== X-Brightmail-scanned: yes Cc: freebsd-questions@freebsd.org Subject: Re: A Question of How to Handle Numerical Notation X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2006 18:44:31 -0000 On Oct 6, 2006, at 11:21 AM, Martin McCormick wrote: > My thanks to you and to one other individual who have > written responses to my questions. You're welcome. > I will talk to the people who extracted the file and see > if there is a possibility we got the wrong data in that field. > One would hope that the time stamp data are normal 32-bit values > that can be sucked in by a %lx in sscanf. No, they aren't, but there is sample code at the end of RFC-4122 which you might want to review. In particular: typedef unsigned64_t uuid_time_t; void get_system_time(uuid_time_t *uuid_time) { struct timeval tp; gettimeofday(&tp, (struct timezone *)0); /* Offset between UUID formatted times and Unix formatted times. UUID UTC base time is October 15, 1582. Unix base time is January 1, 1970.*/ *uuid_time = ((unsigned64)tp.tv_sec * 10000000) + ((unsigned64)tp.tv_usec * 10) + I64(0x01B21DD213814000); } -- -Chuck