From owner-freebsd-questions@FreeBSD.ORG Fri Jun 20 05:48:52 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 A2EE037B405 for ; Fri, 20 Jun 2003 05:48:50 -0700 (PDT) Received: from likya.bimel.com.tr (likya.bimel.com.tr [212.175.96.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEFCC43FA3 for ; Fri, 20 Jun 2003 05:48:48 -0700 (PDT) (envelope-from ustuntas@bimel.com.tr) Received: (from root@localhost) by likya.bimel.com.tr (8.12.6p2/8.12.8) id h5KCkUrU021886 for questions@freebsd.org; Fri, 20 Jun 2003 15:46:30 +0300 (EEST) (envelope-from ustuntas@bimel.com.tr) Received: from bimel.com.tr (zeugma.bimel.com.tr [212.175.96.11]) by likya.bimel.com.tr (8.12.6p2/8.12.7av) with ESMTP id h5KCkTCm021877 for ; Fri, 20 Jun 2003 15:46:29 +0300 (EEST) (envelope-from ustuntas@bimel.com.tr) Message-ID: <3EF30519.1070309@bimel.com.tr> Date: Fri, 20 Jun 2003 15:59:05 +0300 From: Murat USTUNTAS User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: tr, en-us, en To: questions@freebsd.org References: <3EF2FFB6.5000706@bimel.com.tr> <3EF30062.1060506@sundland.com> In-Reply-To: <3EF30062.1060506@sundland.com> Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS perl-11 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Content-Filtered-By: Mailman/MimeDel 2.1.1 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:48:53 -0000 Danny Pansters write me the following message to conver time in python language: %python Python 2.2.3 (#1, Jun 5 2003, 12:59:25) [GCC 3.2.2 [FreeBSD] 20030205 (release)] on freebsd5 Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> time.ctime(1064005200) 'Fri Sep 19 23:00:00 2003' This what you need? --Dan Thank you all for your answers.. :) Regards, Murat Ustuntas Raymond T. Sundland wrote: Within the master.passwd, the time is stored in seconds since the Epoch, and there are standard C and POSIX functions for converting this into any format you want. I don't know much about python, but within Perl you can use strftime() to convert the date. You would do something similar to: strftime("%D", localtime($unixtime)) where $unixtime is assigned to the value you pulled from the master.passwd file. The %D simply returns a MM/DD/YY format date. Check to see if Python has similar functions... they are POSIX compliant. Murat USTUNTAS wrote: Hello all, On my system, some users have expire day user settings. I write a (python) script then parse the: 7.th selection in the master.passwd blabla:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:1064005200:xxxx:xxxx:xxxx:xxxx 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 interactively ? Regards, Murat Ustuntas _______________________________________________ [1]freebsd-questions@freebsd.org mailing list [2]http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [3]"freebsd-questions-unsubscribe@freebsd.org" _______________________________________________ [4]freebsd-questions@freebsd.org mailing list [5]http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [6]"freebsd-questions-unsubscribe@freebsd.org" References 1. mailto:freebsd-questions@freebsd.org 2. http://lists.freebsd.org/mailman/listinfo/freebsd-questions 3. mailto:freebsd-questions-unsubscribe@freebsd.org 4. mailto:freebsd-questions@freebsd.org 5. http://lists.freebsd.org/mailman/listinfo/freebsd-questions 6. mailto:freebsd-questions-unsubscribe@freebsd.org