BEGIN{
printf("Enter date")
getline str<"/dev/tty"
split(str,a,"-")
if(a[1]>0 && a[1]<=31)
{
if(a[2]>0 && a[2]<=12)
system("date +%B%t%A%t%Y -d "a[3]"-"a[2]"-"a[1]"")
else
printf("invalid month")
}
else
printf("invalid date")
}
printf("Enter date")
getline str<"/dev/tty"
split(str,a,"-")
if(a[1]>0 && a[1]<=31)
{
if(a[2]>0 && a[2]<=12)
system("date +%B%t%A%t%Y -d "a[3]"-"a[2]"-"a[1]"")
else
printf("invalid month")
}
else
printf("invalid date")
}
No comments:
Post a Comment