following are the excerpts from the railway refund rules available in indianrail.gov.in website under tab-Rules-Refund for your information.
(1) Subject to the provision of these rules, if a ticket on which reservation of a seat or berth has been made, is presented for cancellation, refund of fare shall be made after deducting cancellation charge from the fare as follows :-
(a) If a ticket is presented for cancellation more than 24 hours before the scheduled departure of the train cancellation charge shall be deducted at the flat rate of Rs....
more... 70/- for A.C First Class/Executive Class, Rs. 60/- for A.C. 2 Tier sleeper class/ A.C. 3 Tier sleeper class/ First class/A.C Chair Car, Rs. 40/- for Sleeper class and Rs. 20/- for Second class.
(b) If the ticket is presented for cancellation within 24 hours and up to four hours before the scheduled departure of the train, cancellation charges shall be 25% of the fare subject to the min. flat rate mentioned in clause (a).
(c) If the ticket is presented for cancellation within four hours before the scheduled departure of the train and up to -
(i) Three hours, when the ticket is for a destination station up to 200 KM.
(ii) Six hours, when the ticket is for a destination station of more than 200 KM but up to 500 KM., and
(iii) Twelve hours , when the ticket is for a destination station of more than 500 KM.,
after the actual departure of the train, cancellation charges shall be 50 % of the fare subject to the min. flat rate mentioned in clause (a).
Provided that for night train leaving between 21:00 hours and 06:00 hours (actual departures), refunds shall be admissible at the station within the time limit specified above or within two hours after the opening of reservation office, whichever is later.
(2) No refunds shall be granted at the station if the ticket is surrendered for cancellation after the expiry of the period mentioned under clause (c) of sub rule (1
You may calculate your time according to the departure of the train.