All pastes #25016 Raw Edit

Someone

public text v1 · immutable
#25016 ·published 2005-10-09 12:08 UTC
rendered paste body
/* 
 * Opdracht 3
 */
int 
Date2Unix(int day, int month, int year, int hour, int minute, int second) {
	
	int UnixTime(0);
	
	// seconds
	UnixTime += second;
	
	// minutes
	UnixTime += minute * SecondsInMinute;
	
	// hours
	UnixTime += hour * SecondsInHour;
	
	// days
	UnixTime += day * SecondsInDay - 1;
	
	// months
	while ( month > 1 ) {
		UnixTime += SecondsInMonth(month, year);
		month--;
	}
	
	// years
	while ( year > 1970 ) {
		UnixTime += SecondsInYear(year);
		year--;
	}
	
	return UnixTime;
}