|
|
ru.unix- RU.UNIX ---------------------------------------------------------------------- From : Stepan Koltsov 2:5020/400 06 Sep 2001 17:36:31 To : "Alexey Neyman" Subject : Re: 1 000 000 000 seconds since the Epoch -------------------------------------------------------------------------------- Hаплодят всякого кала в /tmp, а мне потом разгребать... Hадо #!/bin/sh set -e cleanup() { rm /tmp/epoch 2>/dev/null; } trap cleanup 0 gcc -o/tmp/epoch -xc - << !EOF ... text of program !EOF /tmp/epoch # :-) Alexey Neyman <alex.neyman@auriga.ru> wrote: > On Thu, 06 Sep 2001 14:46:06 +0400 Jen Linkova <jen@comp.chem.msu.su> wrote: > JL> Sergey Skvortsov <skv@protey.ru> wrote: >>> perl -e "print scalar localtime 1000000000;" > JL> >>> Sun Sep 9 05:46:40 2001 > JL> > JL> Таак..Кто следующий? ;-) Это уже n-ый постинг (n>3) за последнее время ;-) > JL> И вообще - зачем все так усложнять? perl, print, scalar, localtime > Hо мне кажется, я знаю, во что это выльется :) > В соревнование, на скольких языках можно сосчитать 10^9 секунд от Эпохи. > Кстати, из книги про POSIX.4, Programming for the Real World, глава Basic > Unix Clocks: > The time call is standard in System V and POSIX.1. It returns the number > of seconds, which are the number of seconds that have expired since the > world was created. According to UNIX lore, the world was created in the > dim, distant past, when monstrous beasts roamed the earth: 00:00 AM, > January 1, 1970. This time is called The Epoch, and in that time there > were no microwaves, compact discs, or ATM machines, and there was very > little cable television. You can see why time doesn't go back any further > than that. > Мой вклад: > ----- epoch.sh ----- > #! /bin/sh > cat > /tmp/epoch.c << !END > #define _POSIX_SOURCE > #include <sys/types.h> > #include <unistd.h> > #include <stdio.h> > #include <time.h> > int main(void) > { > time_t x = (time_t)1000000000; > printf("1.000.000.000 seconds since the Epoch:\n%s", > asctime(localtime(&x))); > return 0; > } > !END > gcc -o /tmp/epoch /tmp/epoch.c > /tmp/epoch > rm /tmp/epoch /tmp/epoch.c > ----- end ----- > -- > -------------------------------+--------------------------------- > May the Sun and Water | Regards, Alexey V. Neyman > always fall upon you! | mailto: alex.neyman@auriga.ru > -------------------------------+--------------------------------- -- mailto:yozh@mx1.ru ICQ:26521795 http://www.mx1.ru/ ... Они жили долго и счастливо и надоели друг другу в один день... --- ifmail v.2.15dev5 * Origin: Defi (2:5020/400) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.unix/7807bc12fe22.html, оценка из 5, голосов 10
|