Absent Member.
Absent Member.
1382 views

QC switches date format from US to UK - therefore stroin wrong date

Had problem with QC in that when Defects were updated/uploaded into QC or downloaded from it the date format changed.

 

ie Computer set up with UK date format dd/mm/yyyy

Excel coloums set up UK format dd/mm/yyyy

QC default (and does not seem to be a reliable way of changing it is m/d/yyyy

 

Therefore entering any day less than 12 can result in QC interpreting it as either the day or month

 

ie 7 Feb 2013 may go in as 7/2/2013 or 2/7/2013 (correct one as identified as in Feb)

 

The same is with the planned test execution

 

The following seems to work for defects (repeate simmilar for Mod and Closed dates)

‘From QC to Excel

Dim Ddate As Date, Ddate1 As Date, Ddate2 As Date

Ddate1 = Bug.Field("BG_DETECTION_DATE")

Ddate2 = Format(Ddate1, "m/d/yyyy")

Ddate = Format(Ddate2, "dd/mm/yyyy")

sheet.Cells(row, 11).Value = Ddate

 

And the Opposite for Excel to QC

Dim Creation , Creation1, Creation2

Creation = sheet.Cells(row, 11).Value

Creation2 = Format(Creation, "dd/mm/yyyy")

Creation1 = Format(Creation2, "m/d/yyyy")

MyBug.Field("BG_DETECTION_DATE") = Creation1

 

Ie

  1. Identify and set the parameter
  2. Proclaim the Format as it is in the parent (either QC or Excel)
  3. Change the Format to the child (either Excel or QC)
  4. Set new value

For Tests the Download seems to work, but the update can become random on how QC will update the feild (especialy if the feild had a value in it at the start)

 

So other that Clearing the feild in QC and then adding the new value, is there a better way of identifying the date format to and from QC?

Tags (2)
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.