Pron Journal

Useful tips for Linux and other issues

Sunday, January 1, 2012

Unixtime quick usage - Seconds to date

1.1 Get unixtime in the console
$ date +%s


1.2 Get unixtime in python
>>> import time
>>> int(time.time())


2 Unixtime to date in the console
$ date -d "UTC 1970-01-01 1294779314 secs"

or
$ date -ud @1294779314


Resources
http://en.wikipedia.org/wiki/Date_(Unix)
http://www.linuxhowtos.org/Tips%20and%20Tricks/converting_unixtimestamp.htm
Posted by pron at 5:29 PM
Labels: Linux

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Labels

  • C (1)
  • Debian (1)
  • Games (2)
  • Linux (20)
  • Openoffice (1)
  • P2P (1)
  • Programming (2)
  • Windows (1)

Blog Archive

  • ▼  2012 (6)
    • ►  April (1)
    • ▼  January (5)
      • Caps lock indicator in Linux / Gnome2
      • Subversion quick configuration
      • Unixtime quick usage - Seconds to date
      • GPG quick usage
      • Add a existing user to existing group (usermod)
  • ►  2011 (1)
    • ►  June (1)
  • ►  2010 (3)
    • ►  June (1)
    • ►  May (1)
    • ►  January (1)
  • ►  2009 (15)
    • ►  December (2)
    • ►  November (2)
    • ►  October (2)
    • ►  May (3)
    • ►  April (1)
    • ►  March (2)
    • ►  January (3)
  • ►  2008 (1)
    • ►  November (1)

About Me

pron
View my complete profile
Awesome Inc. theme. Powered by Blogger.