# Visual Basic - Help Please

**URL:** https://forum.kirupa.com/t/visual-basic-help-please/53931
**Category:** programming
**Created:** [June 9, 2004, 1:00pm UTC](https://forum.kirupa.com/t/visual-basic-help-please/53931 "2004-06-09T13:00:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![CurryCricketer](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@CurryCricketer](https://forum.kirupa.com/u/CurryCricketer)
#### Post date: [June 9, 2004, 1:00pm UTC](https://forum.kirupa.com/t/visual-basic-help-please/53931/1 "2004-06-09T13:00:07Z")

</div>

“In my place”

Hi i need some help with visual basic

I am making a time converter for a school project but when i ask it to convert a time i sometimes get the date 29/12/1899 before the time. Can any one help me get rid of this? Please. Here is the code:

[COLOR=Red]Dim Hours As Integer  
Dim Mins As Integer  
Dim TempTimeH as Date  
[/COLOR]  
'AM or PM??  
[COLOR=Red]Hours = txtHours.Text  
Mins = txtMinutes.Text

Select Case lstAMPM.Text  
Case “PM”  
If Hours = 12 Then  
TempTimeH = TimeSerial(12, Mins, 0)  
Else  
TempTimeH = TimeSerial((Hours + 12), Mins, 0)  
End If  
Case “AM”  
If Hours = 12 Then  
TempTimeH = TimeSerial(0, Mins, 0)  
Else  
TempTimeH = TimeSerial(Hours, Mins, 0)  
End If  
End Select[/COLOR]  
'End AM or Pm??

[COLOR=Red]lblFinTime.Caption = DateAdd(“n”, -(60 \* 10), TempTimeH)[/COLOR]

Thankyou Kindly  
CurryCricketer
