Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timestamp Unix v/s Windows

Status
Not open for further replies.

gawdknows

Technical User
Mar 4, 2003
95
IN
All,

can anyone tell the principal difference between a Unix timestamp when compared to a Windows timestamp ?

I've heard that there is a difference in system timestamp formats on Unix compared to windows . If true can I have
the details.

TIA
 
one difference:

On Unix, if the file is older than (I think) 6 months, you only get the date and year the file was last changed, not the time and date. Windows gives you the date and time, no matter how old the file.

 
bi, this is true for the ls command. If you do a stat call in C you get the full timestamp, ie the number of seconds since the Epoch (01/01/1970).
 
oK Thx.

the epoch landmark would be the princple difference then...since windows does not have this.

Thx. again and This one's a close.
 
Sorry but you'll find that both Windows and Unix have the concept of an epoch (although in Windows case it is "artificial". In both systems the C-based time() call will return the number of seconds since 1/1/1970.

From memory some versions of DOS (the PC version not the IBM mainframe version) used to base the epoch on 1/1/1980 but I can't remember when this changed (such are the perils of old age)

Cheers - Gavin
 
thx for the prelude.
Basically I was gunning for the seconds.micro seconds[hh:mm:ss:nn etc] etc format, but I understand both are nearby the same except (or in some cases ditto) for the landmark each one chooses to put the timestamp on. and the C based time call is prevelant in both the OS.
Thx

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top