How to add current date and time in ctrx_sync_on_window in loadrunner? - performance-testing

I want to add current time and date in ctrx_sync_on_window in loadrunner in below format.
e.g ctrx_sync_on_window("Transfer Report (07/05/21 11:40:28)", ACTIVATE, 7, 0, 1359, 642, "snapshot33", CTRX_LAST);
Please Suggest

See parameterization. Covered in classroom training. Covered in self paced training. Covered in online documentation. Your mentor should be assisting you after training.

Create a parameter (Ctrl+L) with the required format of Date & time (07/05/21 11:40:28 -> dd/mm/YY HH:MM:ss) in the parameter list
Pass this value in ctrx_sync_on_window which needs to be validated.
This should resolve the issue.
PS : I do not exactly remember the notation for Date & time. You need to check and edit the same

Related

How do I filter a Job Estimates vs. Actuals report by customer: job name in QuickBooks Desktop SDK using QBFC?

I have modified some VB sample code to get most of what I need done using the QuickBooks SDK in an app launched from Excel using VBA. I am able to produce both a Time by Job Summary report and a Job Estimates vs. Actuals report, but for the latter I need to produce filtered copies of it for each customer:job reference number, and I'm not sure what the proper syntax is for this even after looking over the specific query in the API Reference for QB Desktop.
I'm fairly sure that this needs to be done during the request phase. Also, I'm using QBFC, so I have tried various combinations that seem logical, but still haven't received the desired output. If it helps, an example of what is needed for the filter would be like: 20-5050 Dan Barton Trucks. Below is my code for the request:
Set jobRQ = requestSet.AppendJobReportQueryRq
customerRef = "20-5050 Dan Barton Trucks"
With jobRQ
.JobReportType.SetValue ENJobReportType.jrtJobEstimatesVsActualsSummary
.ReportEntityFilter.ORReportEntityFilter.EntityTypeFilter.SetValue etfCustomer
' .ReportEntityFilter.ORReportEntityFilter.FullNameList.Add (customerRefID)
.ORReportPeriod.ReportPeriod.FromReportDate.SetValue dateFrom
.ORReportPeriod.ReportPeriod.ToReportDate.SetValue dateTo
.SummarizeColumnsBy.SetValue scbTotalOnly
.IncludeSubcolumns.SetValue True
.DisplayReport.SetValue True
End With
I have commented out the line that doesn't work.

Convert Epoch Unix Date to hh:ss Am/Pm format

How to convert format epoch timestamp string to 'hh:mm Am/Pm' format in logic apps
Reference1:
I agree with #Skin . Also, have you searched for your answer because it very much exists.
You can follow any of these below mentioned references also.
Reference 2:
**Convert JSON Epoch Timestamp to DateTime String- Azure Logicapp **
As mentioned in above reference thread try this one
{
"some_silly_date": "#addToTime('1970-01-01T00:00:00Z', int(substring(item()?['some_silly_date'],6,10)), 'Second')"
}
or if you want it from the JSON into a variable try with initialize variable action in logic App as shown below.
int(replace(replace(variables('data_in'),'/Date(',''),')/',''))
Reference 3. You can follow #Justion Yoo document also.
Reference 4. Initially you are using azure functions tag also in your question so if you want to Convert Unix timestamp to DD/MM/YYYY HH:MM:SS format in other coding domain like C++ , C # follow this document
https://www.epochconverter.com/?q=1600000000

Issue of Reading and Converting Date of Google Calendar Events when language is set to Arabic in C#

I am Using Google APis .net client library to read calendar events.
I have following line of code
newRow["Start"] = pEventItem.Start.DateTime.HasValue ?
Convert.ToDateTime(pEventItem.Start.DateTime) : Convert.ToDateTime(pEventItem.Start.Date);
Where PEventItem is of type Google.Apis.Calendar.v3.Data.Event and NewRow[...] is of type DataRow. The Value of pEventItem.Start.Date is "2019-06-24" (as seen in debug window)
The above line of code works perfect, But fails when UI language / Culture is set to Arabic (SaudiArabia) The same Convert.ToDateTime throws error "String was not recognized as a valid DateTime".
btw, How i am changing the UI language is as below for your information.
Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo(ChangeLanguageTo);
Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(ChangeLanguageTo);
I tried to set 2nd parameter of the Convert.ToDateTime function in an hope that it will convert date correctly...
CultureInfo enUsCulture = new CultureInfo("en-us");
newRow["Start"] = pEventItem.Start.DateTime.HasValue ? Convert.ToDateTime(pEventItem.Start.DateTime, enUsCulture) : Convert.ToDateTime(pEventItem.Start.Date, enUsCulture);
Well Now it does not throw exception, but the returned date is incorrect. value retuned is {21/10/40 12:00:00 ص}
while The actual date pEventItem.Start.Date is "2019-06-24"
I also tried invariant culture also, but result is same, converted date is wrong. What could be the issue?
Regards
There are a few things going on here.
Firstly, if you use EventDateTime.DateTime (e.g. via pEventItem.Start.DateTime) you don't need to call Convert.ToDateTime, because that's already a DateTime?... you can just take the Value property to get a DateTime from a DateTime?. However, I should warn that that can perform time zone conversions that you may not want. (We can't fix the library to avoid those, as it would be a breaking change.) Instead, you may want to parse EventDateTime.DateTimeRaw, which is the original string value returned by the API.
When parsing, I'd suggest using the invariant culture using CultureInfo.InvariantCulture (instead of creating an en-US culture), and parse using DateTime.ParseExact, specifying the format you expect based on whether you're parsing a date or a full date/time.
In terms of "the returned date is incorrect" - I believe that's really just the formatted value that's using the default culture, including the calendar system. We can see that at play in the code below, which constructs the DateTime directly (so can't be affected by any text parsing etc). When formatted using the invariant culture, it shows as 2019-06-24, but when formatted with ar-SA, it shows as "1440-10-21" due to the default calendar system for that culture being System.Globalization.UmAlQuraCalendar:
// Note: when a calendar system is not specified,
// it's implicitly Gregorian.
DateTime date = new DateTime(2019, 6, 24);
Console.WriteLine(date.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
Console.WriteLine(date.ToString("yyyy-MM-dd", new CultureInfo("ar-SA")));
So what you're seeing in the debugger is the correct date - but formatted in a way you weren't expecting.

How to set date time format in Logic App

I have created an API which creates an excel having Date columns too. When I execute the code from local it works well and displays the date as expected.
When I try executing API via Logic App, it changes the date format of that field. How can I set date time in Logic App?
When you have a fixed DateTime-Format you can use the Logic App function "formatDateTime" as follow:
formatDateTime(triggerBody()?['myDate'], 'yyyy-MM-dd')
You can find it under Expressions - Date and Time - "See more" - formatDateTime
I found some useful documentation on Microsoft's site here:
https://learn.microsoft.com/en-us/azure/kusto/query/format-datetimefunction
Here it is .. in action:
Try this to get the current date in GMT format:
The problem is your local machine is running a different Locale than the machine running your code when it is deployed.
You could either set the CultureInfo.CurrentCulture to make sure the right CultureInfo is used.
CultureInfo...
Provides information about a specific culture (called a locale for unmanaged code development). The information includes the names for the culture, the writing system, the calendar used, the sort order of strings, and formatting for dates and numbers.
You could also use the appropriate DateTimeFormatInfo, when writing the date to Excel, it
Provides culture-specific information about the format of date and time values.
Logic apps time zone base on UTC. So, it needs conversion between UTC to your local time.
In my case, 'SE Asia Standard Time', (UTC+07:00); Bangkok, Hanoi, Jakarta. So, you need to convert it as your local time. Here's in my case:
Date convertTimeZone(utcNow(), 'UTC', 'SE Asia Standard Time', 'MMMM dd, yyyy');
Time convertTimeZone(utcNow(), 'UTC', 'SE Asia Standard Time','hh:mm:ss.ff tt')

icCube - How can I modify the information that will be exported in Excel file

This the OutPut of my Excel file :
I want to Change the date to be more comprehensible. Thanks for your Help
This is known issue, will be part of next release.
As a workaround you can use DateToString function in your measure.
DateToString function does not convert currently, will be done in the next release, measures to their values (see issues).
As a workaround you'll have to do this manually :
[Measures].[My Date].value
or
[Measures].[My Date].value->asValue()
The second is needed if you're using a special aggregation method (e.g. min/max/open/close ) and will need Java to be active in icCube (doc)

Resources