Highlighted
Absent Member.. Absent Member..
Absent Member..
8110 views

ALM 11 Date + time display format

Jump to solution

Hello.

 

It was stated by Alexanderk in this post:

http://h30499.www3.hp.com/t5/Quality-Center-Support-and-News/Date-field-format-is-inconsistent/m-p/6061853/highlight/true#M78642

 

that date is stored with time (i.e. full format) in ALM DB.

 

Is there a way, except for changing system time format, to make ALM show Date+time (DD-Mon-YYYY HH24:MI:SS) in specified date fields?

Will such method work for both Requirements and Defects?

 

The data for such fields is transfered from ALM Synchronizer and allready include time. Also i noticed that RQ_VTS field display date in desired way, although no speacial code in workflow or in other noticable place.

 

 

 

 

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.. Absent Member..
Absent Member..

How the situation was resolved in my case:

 

ALM v11.00 do not store time in full format in DB.  We don't need any operations with date in such fields so we accepted workaround and changed field data type to string and made the field
ReadOnly. On WSDL in SM it was also posted as String. Data is tranfered, customer is happy.

 

If you need date and time - use the method described above where time and date are stored in variables and added afterwards.

 

Best Regards.

View solution in original post

0 Likes
5 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..
RQ_VTS, BG_VTS (modified date) fields display date and time, however user defined date fields cannot collect/display time information, though date is stored in date time format in the DB. Since time is not collected they always tends to be 0. Strings are the best bet to store and display date time information. But letting user edit date/time is not wise.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

I use below code. Create a user defined field in which you want to capture time (say it is bg_user_12). Create below function

 

------------------------------------------------------------------------------------------

'Function to autopopulate current time in "Time Reported" Field
Function GetServerTime(strTime)
strDate = CDate(strTime)
strHour = DatePart("h", strDate)
strMin = DatePart("n", strDate)
strSec = DatePart("s", strDate)
If len(strHour) < 2 Then
tempStrHour = "0" & strHour
Elseif (strHour-12) > 0 Then
If len(strHour-12) < 2 Then
  tempStrHour = "0" & (strHour-12)
Else
  temStrHour = strHour-12
End If
Else
tempStrHour = strHour
End If
If len(strMin) <2 Then
strMin = "0" & strMin
End If
If len(strSec) < 2 then
strSec = "0" & strSec
End If
If (strHour-12)<0 Then
GetServerTime = tempStrHour & ":" & strMin & ":" & strSec & " AM"
Else
GetServerTime = tempStrHour & ":" & strMin & ":" & strSec & " PM"
End If
End Function

---------------------------------------------------------------------------------------

 

Now under Defects_Bug_New, you can write something like

 

'New Function to autopopulate current time in "Time Reported" Field
  Bug_Fields.Field("BG_USER_12").IsReadOnly = False
  Bug_Fields.Field("BG_USER_12").Value = GetServerTime(TDConnection.Servertime)
  Bug_Fields.Field("BG_USER_12").IsReadOnly = True

 

This will capture current time as well as make the field as read-only so that no user can edit this field intentionally/ un-intentionally.

Highlighted
Absent Member.. Absent Member..
Absent Member..

Nice workflow code there, will be useful.

 

But a bit sideway of the situation.

Let me explain:

Those date fields are related to SM -> Synchronizer -> ALM integration. They are not populated by ALM itself but the date is transfered  from SM and contains timestamp.

For example, i see in Synchronizer log:

 

08/22/2013,12:18:44,839 INFO (FullSync.Create.From2To1.Source-C00001102) MapFields: Mapping field value from field 'NextBreach' to 'RQ_USER_TEMPLATE_08'.  
08/22/2013,12:18:44,839 INFO (FullSync.Create.From2To1.Source-C00001102) MapFields: Value copied: 'Thu Nov 07 16:17:14 MSK 2013'.  
So timestamp is transfered in date.

 

I assumed that if the date is stored in full format in DB then it's the ALM display issue.

Is it right that timestamp is not stored for user date fields in DB?

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

How the situation was resolved in my case:

 

ALM v11.00 do not store time in full format in DB.  We don't need any operations with date in such fields so we accepted workaround and changed field data type to string and made the field
ReadOnly. On WSDL in SM it was also posted as String. Data is tranfered, customer is happy.

 

If you need date and time - use the method described above where time and date are stored in variables and added afterwards.

 

Best Regards.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.
Hi All, We are planning to create a field which will give us the resolution time in minutes by calculating the time difference between a user defined field and the defect creation time. We have created a field which will be loaded with the server time as soon as the defect is created. Can you help me in figuring out how to create a function to find the difference between this creation time field and the user defined field which is of string type. This might also require to change the time from 12 hour into 24 hour format. My aim is to get the response time (difference between the defect creation time and the user defined (notificaiton time) time field in a minutes format) Thanks, Krishna Mohan Vedala
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.