Pipeline date variable value changed - azure-devops

I have a variable in Azure DevOps pipeline:
TIMESTAMP: "2016-01-16T00:00:00"
I use this variable in my template to substitute variable in this template, but during pipeline execution, pipeline always change format this value to: 01/16/2016 00:00:00.
Is it possible to keep first format? I need variable in exactly this form: 2016-01-16T00:00:00.

Wrap the variable with single quotes:
TIMESTAMP: "'2016-01-16T00:00:00'"
Result:

Related

Is there a way to get the Current Date/Time from a Release Gate REST API Call

Im trying to build a Release Gate using the REST API function, that checks a returned field value against the current date/time, but I cant figure out a way of getting the current date/time
Is there a simple way of achieving this ?
Ideally it would be great to be able to get the highlighted Timestamp
Is there a way to get the Current Date/Time from a Release Gate REST API Call
There is a specific variable for the release pipeline named "Release.Deployment.StartTime" or if you use it in powershell the environment variable is "Release_Deployment_StartTime":
$CurrentTime= $Env:Release_Deployment_StartTime
Write-Host "Current time is $CurrentTime"
It's in UTC and the format is "yyyy-MM-dd HH:mm:ssZ"
eg: "2021-09-24 02:27:44Z"

How could i set yesterday value as default value for a numeric parameter in datastage?

I have a numeric datatype parameter in Datastage.
*parameter name: VAR_ETL_DATE
*format:YYYYMMDD
*ex:20210612
How could i set yesterday value as default value for this parameter?
Format:YYYYMMDD (numeric)
*Example: Today:20210824
*When i run a job including VAR_ETL_PARAMETER with default value, The job should run with yesterday value(20210823)
You can't set it in a static sense, because the date of yesterday is a moving target. The best you could do would be to set it in a controlling sequence job that invokes your job.
Use any of the date offset functions to set the value. For example you could use Date() - 1 as the generating expression directly in the Job activity in your sequence.

SSRS Report Date Parameter Default for the current Year

I have an SSRS Report I've created with a "Date/Time" Parameter I have created. I am trying to create a Parameter that Defaults to the Current Year. For example in "2020" I want the Paramater to default to "01/01/2020" when we hit 2021 I want it to default to "01/01/2021" Here is what I have tried. For my default value in the parameter I have the following expression with no success.
=CDate(Year(Now())+"-"+Month(01)+"-"+Day(01))
You can do this using the following expression.
=DateSerial(YEAR(Today()), 1, 1)
You can use CDate but that relies on strings. DateSerial is easier to work with in your scenario.

Talend Context variable

I am a newbie Talend developer, need a help with context variables. I searched here if there is a solution for similar approach, didnt find it.
In my query I have to use this date range function:
Date BETWEEN to_char((add_months(TRUNC(SYSDATE,'MM'),-2)),'YYYYMMDD')
AND to_char(LAST_DAY(TRUNC(SYSDATE,'MM')),'YYYYMMDD')
We need to use context variable to take advantage to run different date range during runtime. Above function, I replaced in the query with (date between ="+context.daterange+") and trying to plug these functions to Context - value as tree as below:
to_char((add_months(TRUNC(SYSDATE,'MM'),-5)),'YYYYMMDD')'AND'to_char(LAST_DAY(TRUNC(SYSDATE,'MM')),'YYYYMMDD'), I get below error:
java.sql.SQLException: ORA-00905: missing keyword
If I use hard coded value on "Value as tree" context as below then works
"'20150301'and'20150831'"
Trying to replace this with the function. How can I combine that function with AND.
My tJavacode has
context.DATE = (String)row1.NDate;
Can you please help?
Thanks
Date cannot be between two texts. Since your context variables is a String then use to_date function:
"select ... where my_date between to_date("
+TalendDate.formatDate("ddMMyyyy",TalendDate.addDate(new Date(), 2, "MM"))+
",'DDMMYYYY') and
+TalendDate.formatDate("ddMMyyyy",TalendDate.addDate(new Date(), 5, "MM"))+
");"

How can i get only the date and time in selenium IDE

I'm using selenium IDE and i would like to capture only the date and time from a field that was updated
Example:
Updated by James in 07/05/2015 - 09:50
I need to get only this date and the time from the record updated
Is there a way to do this ?
Thanks
Well you can do it with storeEval(). You can use JavaScript to manipulate stored variables. Lets assume that you stored that whole text in variable updated
${updated} == "Updated by James in 07/05/2015 - 09:50"
Now we just need to get that variable and get part of its text:
Command: storeEval()
Target: storedVars['updated'].split(' ')[4]
Value: date
Basically we get updated and we split it into array using space as separator, and then we get 4th element of array, which contains date and store in it new variable date.
Now:
${date} == "07/05/2015"
The same you can do with time.