title: Convert minutes to hours: ,minutes in vb.net
body: <p>I want to convert total minutes to hours and minutes hh:mm.. </p>
  
  <p>This is my code </p>
  
  <pre><code>    Private Sub TextBox5_TextChanged(sender As Object, e As EventArgs) Handles TextBox5.TextChanged
      Dim TotalMinute As Int32
  
      Dim Minute As Int32
      Dim Hour As Int32
  
      Try
          TotalMinute = CType(TextBox9.Text, Int32)
  
          TotalMinute = TotalMinute Mod 1440
  
          Hour = TotalMinute \ 60
          Minute = TotalMinute Mod 60
  
          TextBox5.Text = FormatTwoDigits(Hour) &amp; ":" &amp; FormatTwoDigits(Minute)
  
      Catch ex As Exception
          Exit Sub
      End Try
  
  End Sub
  
  Private Function FormatTwoDigits(ByVal i As Int32) As String
      If 30 &gt; i Then
          FormatTwoDigits = "0" &amp; i.ToString
      Else
          FormatTwoDigits = i.ToString
      End If
  End Function
  </code></pre>
  
  <p>This code works fine under 24 hours.. but counts back from 0 after 24... </p>
  
  <p>For example if the input is 1500 minutes it should say 25:00 not 01:00 </p>