cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Convert string (time string ) to time format

05-28-2009 9:09 AM
380 views 0 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi,

In this line of code

oUserTable.UserFields.Fields.Item("U_SBTime").Value = oDBs_Detail.GetValue("U_SBTime", i)

i am assigning value to user table field of datetime,but it is taking always 12:00 why?

here ia m updating table so, 0:00 is storing in tables

Here iam giving time not date(eg break time ,lunch time)

i entered 12:35 , 11:45

next i want to update this timings like

this

oUserTable.UserFields.Fields.Item("U_SRTime").Value = oDBs_Detail.GetValue("U_SRTime", i)

here i am getting the problem

0 Likes
View Entire Topic
Former Member
0 Likes

Hi Uday,

Use this method.Problem is solved.

Public Shared Function GetEditTime(ByVal DateValue As String) As String

If DateValue.Length = 1 Then

Return DateValue & ":00"

ElseIf DateValue.Length = 2 Then

Return DateValue & ":00"

ElseIf DateValue.Length = 3 Then

DateValue = DateValue.Substring(0, 1) & ":" & DateValue.Substring(1, 2)

Return DateValue

ElseIf DateValue.Length = 4 Then

DateValue = DateValue.Substring(0, 2) & ":" & DateValue.Substring(2, 2)

Return DateValue

End If

Return "00:00"

End Function