Filming a 30 minute TV show can take around 3 to 7 days of actual filming.
It would seem like a 30 minute TV show could easily be filmed in one day but if the TV show is not a live TV show then it can take longer to actually film the show.
Sometimes TV studios film more than one episode of a TV show at a time so that they get enough filmed to have more than one TV show available.
So some TV shows that are 30 minutes long may be filmed the same day and then edited later and it can take a week or longer for a TV show to be edited.
Some actors are so good at acting that they can easily film a TV show in front of a live audience and some shows need to be filmed without an audience.