From owner-freebsd-questions@FreeBSD.ORG Fri Jun 20 05:35:36 2003 Return-Path: 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 A844937B404; Fri, 20 Jun 2003 05:35:35 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id E071E43F3F; Fri, 20 Jun 2003 05:35:33 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) h5KCZEcX025773 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Jun 2003 13:35:19 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)h5KCZEtq025772; Fri, 20 Jun 2003 13:35:14 +0100 (BST) (envelope-from matthew) Date: Fri, 20 Jun 2003 13:35:14 +0100 From: Matthew Seaman To: Murat USTUNTAS Message-ID: <20030620123514.GB25252@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Murat USTUNTAS , questions@freebsd.org, stable@freebsd.org References: <3EF2FFB6.5000706@bimel.com.tr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZoaI/ZTpAVc4A5k6" Content-Disposition: inline In-Reply-To: <3EF2FFB6.5000706@bimel.com.tr> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-11.2 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,HOT_NASTY,IN_REP_TO, PGP_SIGNATURE_2,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MUTT autolearn=ham version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: stable@freebsd.org cc: questions@freebsd.org Subject: Re: How can convert user expired days in human readable ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2003 12:35:36 -0000 --ZoaI/ZTpAVc4A5k6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 20, 2003 at 03:36:06PM +0300, Murat USTUNTAS wrote: > On my system, some users have expire day user settings. I write a=20 > (python) script > then parse the: 7.th selection in the master.passwd >=20 > blabla:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:1064005200:xxxx:xxxx:xxxx:xxxx >=20 > How can I conver the number like 1064005200 to human readable date format= ? > Or, there is a way to collect the information from a command interactivel= y ? That date is given as the number of seconds since the epoch (1 Jan 1970, 00:00 UTC), which is the standard Unix time_t internal time/date representation. You can convert it into human readable format by: % date -r 1064005200 Fri Sep 19 22:00:00 BST 2003=20 Or from within Python, you should have access to strftime(3) or equivalent which will convert a time_t into a human-readable time/date. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --ZoaI/ZTpAVc4A5k6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE+8v+CdtESqEQa7a0RAo3bAJ4mipPunOLUdQzrAz6uaE46ML00lgCdE3gR SKqXSS3O6o3WG5M1ysVmbB4= =qT/7 -----END PGP SIGNATURE----- --ZoaI/ZTpAVc4A5k6--