The warranty period starts from the date mentioned on the invoice of purchase. This is why the invoice copy is imperative for you to claim warranty.
The warranty period differs from brand to brand, therefore do calculate the end of your warranty accordingly. E.g. For a brand that gives 1 year warranty, if you bought your product on 16th January 2017, your warranty will end on 16th January 2018. Hence, even if you find a defect in your product on 14th January 2018, you can still raise a warranty claim as long as it is before your warranty period ends.