The great privilege of the Americans does not consist in being more enlightened than other nations, but in being able to repair the faults they may commit.
User login
Recent comments
- Aspith 1 day 20 hours ago
- Indeed 5 days 9 hours ago
- Very Good Article! 3 weeks 1 day ago
- wow :) 1 month 3 weeks ago
- Picadilly Essential Notebook 2 months 2 weeks ago
- Good job 2 months 2 weeks ago
- Thoughts ... 2 months 3 weeks ago
- The Flag ... 2 months 3 weeks ago
- Where God Speaks 3 months 1 week ago
- Gov Brown meant to say VACATIONS for everyone, not vaccines 3 months 3 weeks ago
Tags in Topics
Popular content
Colophon
Headlines, navigation and ancillary text are set in Fontin Sans. The masthead is set in Museo Slab. Web embedding of these faces on Monochromatic Outlook conforms to the terms of the exljbris Font Foundry Free Font License Agreement.
Body text is set in Apollo MT, licensed for embedded document use by Adobe.


Comments
Gar
Unmatched '
nope
perl -e 'print time() . "\n"'Does that help?
OK, I give up. What does this
OK, I give up. What does this mean? I don't speak Perl, but that is weird syntax.....
Dad
-e is a switch that tells
-e is a switch that tells perl to execute the following command rather than reading a file and executing that. print is the same as in other languages, time() is a function that returns the number of seconds since midnight Jan 1, 1970 UTC, the period is the concatenation operator, and \n is code for a newline character (which needs to be inside quotes so perl knows it's part of a string. Since time() is a function it will not be interpreted if inside quotes, which is why they need be concatenated.
perl -e 'print time() . "\n"'
How would you convert this back to a human readable format?
The value returned by that
The value returned by that line can be used as input for a wide variety of functions in most programming languages. In Unix, the numeric value can be fed to the date command like so:
date -jr 1267574003Which returns:
Tue Mar 2 15:53:23 PST 2010Or it can be done all on one line like so:
date -jr `perl -e 'print time() . "\n"'`Add new comment