I am trying to create a variation on my welcome node which will advise user if their Active Directory(AD) password is due to expire in next 30 days, and if it is to show how many days until it expires.
I have a context variable for PasswordExpiry coming from AD. Can i use context variable as a condition for the node - ie if bot recognizes xxx?
How can i get it to display number of days between today & password expiry date?
my welcome node currently has this:
context.passwordExpires &&
context.passwordExpires.minusDays(30) < now()
? 'Your login password is due to expire on ' +
context.passwordExpires.reformatDateTime('MMMM d, yyyy') +
' at ' +
context.passwordExpires.reformatDateTime('h:mm a') +
', which is within 30 days. Please change it now!'
: 'not 30'
This code works, but i want to use outcomes of this to jump to different nodes - so if less than 30 days goes to a particlaur welcome answer with options, and over 30 goes to another welcome reponse with options.
Ideally i also want to be able to say your password expires in xxx number of days.
I have tried to make the contect variable a condition for the node so like this context.passwordExpires.minusDays(60) but i cant get this to work
You can use the java.util.Date.getTime() function to return the dates in milliseconds. Then divide the result to get the number of days.
More details in documentation here:
https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-methods#dialog-methods-dates-java-util-date
Related
I have a report that displays monthly and ytd amounts. I use start and enddate parameters that change according to the user. For example for startdate 4/1/2007 and enddate 2/28/2008
1. I need to display title as Monthly budget 2/1/2008 to 2/28/2008
2. I need to display title for YTD as YTD 4/1/2007 to 2/28/2008
I tried = Parameter!EndDate.value but it throws error
It looks like you may have missed a letter in your expression. It should be:
=Parameters!EndDate.Value
In the expression editor you can double click on the parameter name and it will insert it into the expression for you.
To get the full description that you mentioned, you'll need to use a combination of functions. One useful one to look at is DateAdd to add days and months to the specified date. Another one is FormatDateTime which allows you to use the standard "ShortDate" format.
If you run into further trouble, I would recommend posting a new question with the variations of code that you tried along with the specific error messages that you received.
You could try setting the Expression for a text box to:
="Monthly Budget " & FORMAT(Paramters!StartDate.Value, "MM/dd/yyyy") & " to " & "FORMAT(Paramters!EndDate.Value, "MM/dd/yyyy")
This will give you:
Monthly Budget 02/01/2008 to 02/28/2008
It is the same for your second requirement, just change the wording.
Currently working with Blue Prism and I want my exception report to only bring back exceptions from the last 24 hours.
I have tried using 'Today()' in the 'Report From Dt' and 'Report To Dt' which works fine however there is a chance my process will ru into the next day and thus makes this not viable.
Is there a calculation for the past 24 hours?
The action "Get Reports Data" from BO "Work Queues" requires an input in form of DateTime variable.
The Today() function outputs a variable of the type Date, which is then cast into the datetime variable. When BluePrism casts a date to datetime, then it sets a time to a midnight. The answer for your problem is that you need to supply the action "Get Reports Data" with the DateTime variable that will be a datetime of now - 24hours!
Example solution to that could be:
Now()-MakeTimeSpan(0, 24, 0, 0)
First of all, I'm new to SPSS modeler, sorry if my question sound too obvious for experts, but what I'm trying is to calculate the date difference between two date values ( arrive_Date , Depart_Date ) in (Hours), I used this function time_hours_difference , this function works okay if the Arrive_Date and depart_date are the same day, but if the days are different, the date difference is in negative value, I searched and enabled this option: Rollover days/mins in stream properties, but the problem remains the same.
I hope you can help me with this beginner question.
Thanks
Hope its not too late. You are getting negative values because time_hours_difference extract only the time from the two specified timestamps and computes the difference out of it. It doesn't take the date values into account.
For example:
time_hours_difference('2012-08-02 14:10:50,2012-08-05 13:36:26)
Output:
-0.573
Remember, here time_in_hours('0130') under time format 'HHMM' evaluates to 1.5.
Here is my solution: in order to take days into account, first extract date_days_difference and multiply it with 24 to bring it in Hours and then sum it up with the time difference using time_hours_difference.
date_days_difference(arrive_Date,Depart_Date)*24 +
time_hours_difference(arrive_Date,(to_string(datetime_date(arrive_Date)) >< " 23:59:00")) +
time_hours_difference((to_string(datetime_date(Depart_Date)) >< " 00:00:00"),Depart_Date)
I need to:
Set the form to "Not accepting responses" every weekday at 7:16 am
Then set the form to “Accepting responses” every weekday at 5:30 am
Clear all responses from the form and the form spreadsheet on Friday at 2:00 pm
I have no experience with writing scripts. This is for a teacher sign-in sheet for a public high school.
Any help is greatly appreciated!
Unfortunately, StackOverflow isn't here to write your code for you, so you won't receive an answer that you can copy/paste and get to work. The community will instead assist you with any specific roadblocks that you encounter with your code (If they can).
However, you'll be able to achieve this with the Form Service, specifically, the '.setAcceptingResponses()' method. You'll also need the Spreadsheet service with the '.clear()' method to empty the sheet.
You'll find the time triggers are the easiest way to set when the form becomes active and inactive again, however, you've mention very specific times that this needs to go offline and online again (7:16 am and 5:30 am, but only on weekdays, and 2PM to clear the sheet on Fridays), but Google Apps script time triggers can't be set down to the minute (Note the triggers explanation about the time being randomized).
An alternative would be to write a function that checks the time, have that function run every minute, and if the time = 2PM on a Friday then clear the sheet etc.
have you checked out formLimiter by New Visions Cloud Lab?
http://cloudlab.newvisions.org/add-ons/formlimiter
The description is:
formLimiter automatically sets Google Forms to stop accepting responses after a maximum number of responses, at a specific date and time, or when a spreadsheet cell contains a specified value.
Great for time-bound assignments, event registrations with limited seats, or other first-come, first-served signup scenarios.
I was able to write a short script and set a trigger, I named my form "Play"
Here is the script:
function limitDays() {
var form = FormApp.getActiveForm();
var lastDay = 21;
var currDate = new Date();
var dayOfMonth = currDate.getDate();
if (dayOfMonth > lastDay) {
form.setAcceptingResponses(false);
} else {
form.setAcceptingResponses(true);
}
}
I need to check what’s the current date where the user is in.
I don’t need the time, just the current date.
How can i do it?
I'm using codeigniter.
Thanks.
I've managed to get the date on the client side.
My problem is that i get an error (0) when trying to parse it using strtotime.
I know that means the string is not ok but when i do an echo it displays ok(07/11/2010).
Here's the code:
javascript:
function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year
HTML:
$curdate="";
$newdate = strtotime ( '-0 year' , strtotime ( $curdate ) ) ;
$curdate=date ( 'Y-m-d' , $newdate );
echo form_hidden('curdate','',$curdate);
The web server and, by extension, your application do not have this information. You have to get that input from the client side somehow. A couple of ideas come to mind:
Ask the user what time zone they're in (e.g., with a form), then calculate their date based on that.
Use some JavaScript that finds the information automatically (e.g., getTimezoneOffset()). Optionally, submit this information to your app via Ajax.