View previous topic :: View next topic |
Author |
Message |
schrippe Guru


Joined: 03 Mar 2004 Posts: 556 Location: Mülheim
|
Posted: Tue Aug 30, 2005 7:57 am Post subject: wie wandele ich die unix zeit in die normale Uhrzeit? |
|
|
hallo,
habe hier jede menge sekunden seit 1970. da gibts doch sicherlich nen proggi was das umrechnen kann, oder?
1124968017432255 = ? ? _________________ for i in $(seq 1 565); do echo 'A$i: entweder rechts fahren oder rechts überholen dürfen!';done |
|
Back to top |
|
 |
Vaarsuvius Guru


Joined: 02 Dec 2004 Posts: 345
|
|
Back to top |
|
 |
schrippe Guru


Joined: 03 Mar 2004 Posts: 556 Location: Mülheim
|
Posted: Tue Aug 30, 2005 9:07 am Post subject: |
|
|
und wie mache ich das, wenn ich es in einem script benutzen will?? _________________ for i in $(seq 1 565); do echo 'A$i: entweder rechts fahren oder rechts überholen dürfen!';done |
|
Back to top |
|
 |
Arudil Tux's lil' helper

Joined: 26 Jun 2004 Posts: 144
|
Posted: Tue Aug 30, 2005 9:28 am Post subject: |
|
|
hehe
1124968017432255 = 19.01.2038 04:14:07
stimmt nicht wirklich
denn: 2147483647 = 19.01.2038 04:14:07
das obere Ergebniss kommt nur durch einen Pufferoverflow im 32bit-timestamp zustande. Und deshalb geht eine Sekunde nach 2147483647 auch die Welt unter. Aber das ist ein anderes Thema. (->)
im Script kannst du folgendes verwenden:
date -d "1970-01-01 UTC 2147483647 seconds" +%x\ %X |
|
Back to top |
|
 |
think4urs11 Bodhisattva


Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Tue Aug 30, 2005 9:33 am Post subject: |
|
|
oder so: Code: | perl -e 'print scalar localtime 1125394309' |
_________________ Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself |
|
Back to top |
|
 |
_hephaistos_ Advocate


Joined: 07 Apr 2004 Posts: 2694 Location: salzburg, austria
|
Posted: Tue Aug 30, 2005 9:59 am Post subject: |
|
|
oder php date()
date("YmdHis", sometsp);
- geht auch via CLI
hth,
ciao _________________ -l: signature: command not found |
|
Back to top |
|
 |
toskala Advocate


Joined: 14 Dec 2002 Posts: 2080 Location: hamburg, germany
|
Posted: Tue Aug 30, 2005 10:41 am Post subject: |
|
|
Code: | toskala@nemesis ~ $ cat bin/unixtimeconverter.sh
#!/bin/bash
if [ a$1 == "a" ]; then
echo -e "usage: unixtimeconvert.sh <seconds>";
exit 0;
fi
UNIXTIME="$1"
DATE=$(date -d "1970-01-01 UTC $UNIXTIME seconds" +"%Y-%m-%d %T %z")
echo -e "$DATE"; |
schreib das in nen bashscript, dann kannste es mit dem unixtime parameter aufrufen...
achja, edit:
naja, du kannst ja den date aufruf in jedem anderen bash-script verwenden, dann kannste das zerhackstücken und woanders reinstopfen _________________ adopt an unanswered post
erst denken, dann posten |
|
Back to top |
|
 |
|