Source From Here
Question
How do I convert Epoch seconds to the current time under UNIX or Linux operating systems? Unix time, or POSIX time, is a system for describing points in time, defined as the number of seconds elapsed since midnight proleptic Coordinated Universal Time (UTC) of January 1, 1970, not counting leap seconds
How-To
Print Current UNIX Time
Type the following command to display the seconds since the epoch:
Convert Epoch To Current Time
Type the command:
Please note that @ feature only works with latest version of date (GNU coreutils v5.3.0+). To convert number of seconds back to a more readable form, use a command like this:
AWK Example
Perl Example
Question
How do I convert Epoch seconds to the current time under UNIX or Linux operating systems? Unix time, or POSIX time, is a system for describing points in time, defined as the number of seconds elapsed since midnight proleptic Coordinated Universal Time (UTC) of January 1, 1970, not counting leap seconds
How-To
Print Current UNIX Time
Type the following command to display the seconds since the epoch:
Convert Epoch To Current Time
Type the command:
Please note that @ feature only works with latest version of date (GNU coreutils v5.3.0+). To convert number of seconds back to a more readable form, use a command like this:
AWK Example
Perl Example
沒有留言:
張貼留言