42-archive/libftasm/srcs/time/ft_time_isrecent.c
2017-03-31 21:42:02 +02:00

24 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_time_isrecent.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/03 18:01:04 by jhalford #+# #+# */
/* Updated: 2017/03/21 15:44:24 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_time_isrecent(time_t event)
{
time_t now;
now = time(&now);
if (now - event >= 0 && now - event <= 6 * 365 / 12 * 24 * 60 * 60)
return (1);
else
return (0);
}