Murat USTUNTAS
2003-Jun-20 05:29 UTC
How can convert user expired days in human readable ?
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
Sergey Akifyev
2003-Jun-20 05:33 UTC
How can convert user expired days in human readable ?
On Fri, 2003-06-20 at 16:36, Murat USTUNTAS wrote:> 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 ?date -r 1064005200 -- regards, Sergey Akifyev <asa@gascom.ru> JSC Gascom <http://www.gascom.ru> PGP key available from: ftp://ftp.gascom.ru/pub/PGP-keys/asa.txt -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: This is a digitally signed message part Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20030620/8ddee2da/attachment.bin
Dimitry Andric
2003-Jun-20 05:35 UTC
How can convert user expired days in human readable ?
On 2003-06-20 at 14:36:06 Murat USTUNTAS wrote:> How can I conver the number like 1064005200 to human readable date > format ?Try: date -r 1064005200 And read the date(1) manpage for more information. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 183 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20030620/d30c4a5b/attachment.bin
Murat USTUNTAS
2003-Jun-20 05:37 UTC
How can convert user expired days in human readable ?
Thank you so much... I just adding the command , everything in fine. Regards Murat Ustuntas Sergey Akifyev wrote: On Fri, 2003-06-20 at 16:36, Murat USTUNTAS wrote: 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 ? date -r 1064005200
Matthew Seaman
2003-Jun-20 05:38 UTC
How can convert user expired days in human readable ?
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 > (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 ?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 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 -- 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20030620/1e21ae9f/attachment.bin
Raymond T. Sundland
2003-Jun-20 05:44 UTC
How can convert user expired days in human readable ?
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 > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org"
Possibly Parallel Threads
- httpd exited on signal 11
- Gigabit Ethernet Security With Ipfilter
- [LLVMdev] tools to debug human readable llvm assembly bc code?
- [LLVMdev] tools to debug human readable llvm assembly bc code?
- [Bug 505] New: ssh -V could print a human readable openssl version string