datetime value convert on variable save - octopus-deploy

I am trying to save a date as an octopus variable
The date format is like 2019-05-26T00:00:00+00:00
But while trying to save this octopus is automatically converting it into 05/25/2014 20:00:00 this formart.
Please suggest any way to save the variable in the original(i.e. 2019-05-26T00:00:00+00:00) format

You can use a filter to format the datetime correctly like this:
"#{Time | Filter "yyyy-MM-ddTHH:MM:ss"}"

Related

using date_format in fetch url variable in smarty

{$GLOBALS.settings.listing_last_updated_date} gets date from db in format
Aug 4, 2016
I need date output as |date_format:"%m.%d.%Y" ie. 08.04.2016
{fetch file="http://`$smarty.server.HTTP_HOST`/latest/?action=search&activation_date[not_less]=`$GLOBALS.settings.listing_last_updated_date|date_format:"%m.%d.%Y"`" assign='last_updated_date'}
Wherever I use {$last_updated_date} I should get fetched content from http://mysite/latest/?action=search&activation_date[not_less]=08.04.2016
The actual problem is using date format |date_format:"%m.%d.%Y" is not working in fetch variable.
It won't work that way, Try to generate the date in a separated variable and then add it to the url:
{$last_update=$GLOBALS.settings.listing_last_updated_date|date_format:"%m.%d.%Y"}
{fetch file="http://`$smarty.server.HTTP_HOST`/latest/?action=search&activation_date[not_less]="|cat:$last_update assign='last_updated_date'}

CDate can't convert from string dd/MM/yyyyy in Report

06/07/2559 < this is dd/MM/yyyy
This is ok for converting but CDate convert to this format MM/dd/yyyy
If I use this
30/06/2559 I'll get error because CDate think 30 is a month.
Anyway to convert my string dd/MM/yyyy to Date in Report?
Thanks in advance
Three ways/things that you can do to achieve this -
You can set the localisation format at the report level which means you don't have to use the format function every time you drop a date on to the report.
You can covert the string to your required format ('mm/dd/yyyy' or 'dd/mm/yyyy') in database itself. For your reference in MSSQL you can do it like this -
You can format (use FORMAT() function) your code in SSRS itself somewhat like below -
On that field change attibute Language to es-Es (or any other country that uses dd/MM/yyyy format)

how to convert this string '2014-12-31T05:00:00.000+00:00' into date in informatica

i have my date coming in string form :'2014-12-31T05:00:00.000+00:00'
how can TO convert this into date format in informaticA
Take a sub string of the time string '2014-12-31T05:00:00.000+00:00' to '2014-12-31' after all you need date part only.
Then parse the date using to_date method.
to_date('substring date','yyyy-dd-mm')
You can use this:
to_date('2014-12-31T05:00:00.000+00:00', 'YYYY-MM-DD.HH:MI:SS.MS......')
Keep in mind that it ignores the time zone information.

Comparing dates in Xpath with different formats

I have a date in this format "21-Mar-2014"
I already tried to search for Xpath formulas but with no use
I am getting the first format 21-Mar-2014 using SeleniumIDE and want to check if this value is the date of today,
So how can xpath generate today's date and compare it for the date extracted using Selenium
You can parse the string into a date with an xpath function such as date:date(string) (described in this question).
Today's date already in xml date format is supplied by fn:current-date() (see here)
You can get the value, sore it in a variable, and then compare it. Eg:
storeText //xpath/goes/here myDate
storeEval (new Date(storedVars['myDate']) > new Date()) isAfterToday
Note, the storedVars array holds all the variables.
new Date should parse most formats, otherwise you can use any javascript in the storeEval stage to reformat it.

How to format birt date report parameter?

By default if the input parameter to BIRT report is of type Date, it takes yyyy-MM-dd format.
Can we change to something else e.g. may be dd/MM/yyyy ?
You can change the input format for a date parameter. Click on "Change..." select Format as "Custom" and you can enter a valid format code as you like.
If you want to enter a default Date you still have to use the yyyy-MM-dd Format, this cannot be changed ( where I used new Date() in the Picture), but the output format will still be your entered format.
Another option is to use the format Date Time section in the Birt designer and choose the right locale and formatting for the date.
I have done it in Birt 3.7 and works fine
There can be many way to do that but the easy one is you can do this in SQL Query itself.
If you are using DB2 you may try
VARCHAR_FORMAT("Your Column Mapping Name",'DD-Mon-YYYY') AS dataSetName.
But this will change its Data type to String
Try if this make any seance.

Resources