Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jun 2003 13:35:14 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Murat USTUNTAS <ustuntas@bimel.com.tr>
Cc:        questions@freebsd.org
Subject:   Re: How can convert user expired days in human readable ?
Message-ID:  <20030620123514.GB25252@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <3EF2FFB6.5000706@bimel.com.tr>
References:  <3EF2FFB6.5000706@bimel.com.tr>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030620123514.GB25252>