tags:

views:

74

answers:

3

Is there a way to use unix date to print the number of seconds since epoch?

I'm open to using other standard shell commands if there is a way

(I'm using Solaris, so there isn't date "+"%s")

Thanks

+2  A: 
perl -e 'print time'
Marcelo Cantos
+2  A: 

Well, since this is a programming site, I would just compile something like:

#include <stdio.h>
#include <time.h>
int main (void) {
    printf ("%d\n",time(0));
    return 0;
}

:-)

paxdiablo
A: 

you can try nawk,(but try to double confirm with the perl commands and see if they give the same results)

nawk "BEGIN{print srand}"
ghostdog74