AlbertAguirre
Programmer
I need to display the current date and time in the unix timestamp format.
How do I do this at the command line?
How do I do this at the command line?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <time.h>
#include <stdio.h>
# udate.c - print seconds since "the epoch"
main ()
{
time_t nowsec;
nowsec = time (&nowsec);
printf ("%ld\n", (long)nowsec);
}
#!/usr/bin/perl
# udate.pl - print seconds since "the epoch"
print scalar time, "\n";