i want to make UiPath recognize Now.toString as my own hard coded date, like
Assign: Now.toString = “01/05/2023”
how to achieve this?
i want to make UiPath recognize Now.toString as my own hard coded date, like
Assign: Now.toString = “01/05/2023”
how to achieve this?
@wija
please follow
Now.ToString(“dd/MM/yyyy”)
if you want to go back one month then
DateTime.Now.AddMonths(-1).ToString(“dd/MM/yyyy”)
no, not like that, i already understand that
what i want is:
so whenever i call the code “Now.toString” in another flow, the UiPath not going to get true current date, but get my own hard coded date instead.
i want
whenever i call the code “Now.toString” in another flow, the UiPath not going to get true current date, but get my own hard coded date instead.
if right side of assign is Now.toString(“dd/MM/yyyy”) then what is the left side of the assign? is the “01/05/2023” ?
sounds like
myDate = CDate(“01/05/2023”) - so my date will be the 5th Jan 2023
almost there, but i don’t want to manipulate variable myDate, what i want to manipulate is the code “Now.toString” it self
@wija
If you want to get previous month first day from now.tostring then
assign activity
→ Date1= DateTime(Date_Now.Year,Date_Now.Month,1).AddMonths(-1)
no what i want is to manipulate “Now.toString” it self to be ANY hard coded date.
because i have so many flow that already using Now.toString not variable.
so whenever i call the code “Now.toString” the UiPath not getting true current date, but my own hard code date.
we recommend to recheck the code basics
Now is retrurning the current date
CDate is converting a string into a date
Using the Now for getting a date is not made for a usage to set Now to another date. If you feel that your question is not right understood then
@wija ok.
the simply make a variable
then use assign activity and store like this
Date1=“01/05/2023”
and use this variable where Now.Tostring present
so what i want is not achievable.
and i have to revise all of my “Now.toString” to be using a variable first
@wija definately because “Now.ToString” command not a variable. That’s why you need to change everywhere where it is present
we adressed with
when you need a variable representing a particular date which is not the day of today then we would recommend to use one of the different string to datetime conversion methods for getting it
the thing is the project requirement is to get current date, so actually i don’t have revise any of my flow.
but my client not giving me any latest data for me to test it. i only have old data, so i have to roll back my “Now.toString”, but like what i stated in this posting, it is not achievable until i’m declare my “Now.toString” into a variable at a begining of my flow, then use the variable for the rest of my flow.