grails - How to convert Time in String format ("12:45" or it can be "725:00" ) to minutes in java? -
i trying convert time in string format minutes. can use substring , find minutes there problem because there chance of getting time in format 720:00 hours. (as calculating time many days) pls me.... in advance........
hussain
as far understood, need calculate how many minutes in given hours , minutes. well, i'd fast , simple:
string time = "725:00"; string[] parts = time.split(":",2); int hours = integer.valueof(parts[0]); int minutes = integer.valueof(parts[1]); return hours*60+minutes;
Comments
Post a Comment