Re: Comparing time in Linux



Binary wrote:
Hi,

Any command or script to compare the date/time in Linux? I want to know
a date is later or ealier than another. Such as 2005/10/10 >
2004/11/21?

Apart from the mktime() approach this other person ("say88") suggests, you could also just build a non-consecutive day-number:
(year * 12 + month - 1) * 31 + day - 1


This will still fit in 32 bits for quite some time.

--
Josef Möllers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett

.



Relevant Pages