Uccx comparing time objects in script crossing dates
Hi There!
Im using Jonathan Schulenberg sub_datetime.aef script which is an awesome script for grabbing
Timezone,currentTime,currentTimeInt date and dayofweek information.
I have implemented a script at a customer site using this logic and it works great!
But i bumped into a weakness in my solution that i wonder íf somebody can help out with!
For instance if i compare if a queue shall be open or closed by doing an IF on the following logic
If (currentTimeInt >= 070000 && currentTimeInt <= 180000) Then
True -> Goto CSQ-Step
False -> Goto ClosedPrompt, that works ok
But if i want to compare
If (currentTimeInt >= 070000 && currentTimeInt <= 010000) and trying to do same logic it fails....
because in some cases my customer want to keep a queue open to 010000 AM due to extend their support open hours!
The question is are there any built-in script method or function that can be used when do a compare on PM and AM times and then crossing dates. I
IF so this way you could have a fully controlled TOD/DayOfWeek where several application/scripts could use a common SQL DB for storing business hours, exceptions etc.
Somebody?!
rgds Mikael
Hi Geof!!
Thx. for you reply! I shall test this since i already check weekday-numbers in my logic!
Just a thought normally i think the CurrentimeInt returns 010000 (when 01:00 am) so i guess you mean that i shall
read a Substring of 010000 i.e dig out 10000 from the variable, right?!
Are there any other ways to do it with T[now] functionality or so?
rgds, Mikael
Similar Messages
-
Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?
List and table controls -> listbox..is that what you are thinking of?
The listbox presents the user with a list of options, and you can set it to only accept one selection at a time...Adding new data to the list can not be done directly by the user but if you make e.g. a text control and a button you can programatically insert new objects described in the text box when the button is pressed...(see example).
If you need more than one column you have the multicolumn listbox. If you want the users to write new entries directly yu can use a table and read selected cells using it's selection start property to read what cell has been selected.
MTO
Attachments:
Listbox_example.vi 34 KB -
Type of object from a database date/time column
Hello everyone,
I've got a concern regarding the way in which coldfusion is
treating date/time columns in a database.
In my opinion when I select a column that is let's say
timestamp type - the object in a query is CF's date/time object.
I've checked the query by getMetaData() and it looks like each
column has its own database type (eq. varchar2, date, etc).
My concern comes from a fact that I've heard that Coldfusion
is treating the date-time columns in a database as strings and in
each case it parses them. So the difference in a locale between a
database server and a Coldfusion server may result in a wrong
date/time object.
Example:
Locale of database EU: yyyy/mm/dd
Locale of Coldfusion US: yyyy/dd/mm
The date like 1st of February 2007 stored in a database would
look then in Coldfusion like: 2nd of January 2007
Could someone please confirm which version is valid?Johnny852 wrote:
> In my opinion when I select a column that is let's say
timestamp type - the
> object in a query is CF's date/time object. I've checked
the query by
> getMetaData() and it looks like each column has its own
database type (eq.
> varchar2, date, etc).
if you already know cf is returning a datetime from a
datetime in the db, what's
the question?
> My concern comes from a fact that I've heard that
Coldfusion is treating the
"fact"? unless the datetime is stored as a string, that's not
a "fact".
> Example:
> Locale of database EU: yyyy/mm/dd
> Locale of Coldfusion US: yyyy/dd/mm
btw neither of your example "locales" are in fact locales.
> The date like 1st of February 2007 stored in a database
would look then in
> Coldfusion like: 2nd of January 2007
if you pass a numeric string representation (2/1/2007 for
instance) of a date to
cf, it will be interpreted via the cf server's "default"
local (ie en_US,
month/day/year) unless you use one of the LS functions like
LSParseDateTime() &
specifically set the the locale (like setLocale("th_TH")) or
make the date
non-ambiguous (2-feb-2007) or build the date yourself from
user input using
createDate() or createDateTime(). you just need to convert
the user's string
representation to a valid cf datetime object (or i guess
force to database to
follow the user's locale date mask). -
Change the icon displayed beside date/time object?
Hello,
does anybody knows if it is possible to change the icon that is displayed beside the date/time object (when you click on it the calendar opens)? My customer stated that it is a bit confusing because it looks like a normal dropdown, not like a calendar.
Regards, KarinHawker,
Clarify me whether u want to save this date field to only a single table or two tables.
Regards,
Gyan -
How can I generate a real-time highchart from my database data?
I have looked several links; however, I couldn't find a working demo showing how to implement a highchart using data from a database.
Objective: I want to generate a real time highchart line graph getting data from my database. What I want is very similar to the
HighChart Demo which provides a real-time highchart with randomly generated values. It is also similar by X-axis and Y-axis, for I want my x-axis to be "Time" (I have a DateTime column in my database) and y-axis to be an integer (I have
a variable for that as well in my database).
Please I need help in sending the model data to my razor view.
Note that I am already using SignalR to display a realtime table. I also want to know if it can be used to automatically update the highchart as well.
Below is the code snippet of my script in the view. I have used the code provided in
HighChart Demo link for generating the highchart. Please tell me where should I apply the changes on my code.
@section Scripts{
<script src="~/Scripts/jquery.signalR-2.2.0.js"></script>
<!--Reference the autogenerated SignalR hub script. -->
<script src="~/SignalR/Hubs"></script>
<script type="text/javascript">
$(document).ready(function () {
// Declare a proxy to reference the hub.
var notifications = $.connection.dataHub;
//debugger;
// Create a function that the hub can call to broadcast messages.
notifications.client.updateMessages = function () {
getAllMessages()
// Start the connection.
$.connection.hub.start().done(function () {
alert("connection started")
getAllMessages();
}).fail(function (e) {
alert(e);
//Highchart
Highcharts.setOptions({
global: {
useUTC: false
//Fill chart
$('#container').highcharts({
chart: {
type: 'spline',
animation: Highcharts.svg, // don't animate in old IE
marginRight: 10,
events: {
load: function () {
// set up the updating of the chart each second
var series = this.series[0];
setInterval(function () {
var x = (new Date()).getTime(), // current time
y = Math.random();
series.addPoint([x, y], true, true);
}, 1000);//300000
title: {
text: 'Live random data'
xAxis: {
type: 'datetime',
tickPixelInterval: 150
yAxis: {
title: {
text: 'Value'
plotLines: [{
value: 0,
width: 1,
color: '#808080'
tooltip: {
formatter: function () {
return '<b>' + this.series.name + '</b><br/>' +
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
Highcharts.numberFormat(this.y, 2);
legend: {
enabled: false
exporting: {
enabled: false
series: [{
name: 'Random data',
data: (function () {
// generate an array of random data
var data = [],
time = (new Date()).getTime(),
i;
for (i = -19; i <= 0; i += 1) {
data.push({
x: time + i * 1000,
y: Math.random()
return data;
function getAllMessages() {
var tbl = $('#messagesTable');
var data = @Html.Raw(JsonConvert.SerializeObject(this.Model))
$.ajax({
url: '/nurse/GetMessages',
data: {
id: data.id,
contentType: 'application/html ; charset:utf-8',
type: 'GET',
dataType: 'html'
}).success(function (result) {
tbl.empty().append(result);
$("#g_table").dataTable();
}).error(function (e) {
alert(e);
</script>Hi Sihem,
Thank you for contacting National Instruments. Using the LabVIEW Real-Time module, you can do development without actually having a target. While viewing the project explorer window, you can do the following steps:
Right click on the project
Select New >> Targets and Devices
Select the "New Target or Device" radio button
Select the target you would like to develop on.Information about the LabVIEW Real-Time Module can be found here.
Regards,
Kevin H
National Instruments
WSN/Wireless DAQ Product Support Engineer -
Want to compare same object in different systems
hi all,
i want to compare same object in different systems
example:
same transfer rule in BID to be compared with the one in BIT/BIP
in these kind of cases, pls help me on how to do the comparison.
as i have to do some enhancement in BID and release that changes to BIT/P. but while manually checking i might also miss out any important changes which might create issues.
pls suggest.Could you please use the below table for comparision.
Cubes RSDCUBE
DSO's (to identify DSOu2019s based on time stamp field) RSODSO
Multiproviders RSDCUBEMULTI
Infosets RSQISET
Trasnformations RSTRAN
DTP's RSBKDTP, RSBKDTPSTAT
Trasnfer strcuture RSTS
Infopackages RSLDPIO
Update Rules RSUPDINFO
Aggregates RSDAGGDIR/RSDAGGDIR
Process Chians RSPCCHAIN
OHD's
data sources status ROOSOURCE,RSDS
Regards,
Saveen Kumar -
If I have two string variables both of whom contain time readouts, for example:
String t1 = "12:10:04";
String t2 = "12:10:24":
Can they be converted to time objects so they can be compared, i.e. t2-t1 = 00:00:20?See java.text.SimpleDateFormat and java.util.Date.
Parse your strings into Dates, subtract one Date's millis from the other, create a new Date, and format that as you wish. -
How to update ADF VO object to refresh the data in ADF Pivot table
I need to know how to update the View object so that the date in pivot table is refreshed/updated/filtered.
here are the steps I performed to create ADF pivot table application using VO at design time.
1) created a collection in a Data Control (ViewObject in an ApplicationModule) that provides the values I wanted to use for row and column labels as well the cell values (Used the SQL query)
2) Dragged this collection to the page in which wanted to create the pivot table
3) In the pivot table data binding editor specified the characteristics of the rows (which attribute(s) should be displayed in header), the columns (likewise) and the cells.
Now, I have a requirement to update/filter the data in pivot table on click of check box and my question is how to I update the View object so that the date in pivot table is refreshed/updated/filtered.
I have got this solution from one of the contact in which a WHERE clause on an underlying VO is updated based upon input from a Slider control. In essence, the value of the control is sent to a backing bean, and then the backing bean uses this input to call the "filterVO" method on the corresponding AppModule:
but, I'm getting "operationBinding" object as NULL in following code. Please let me know what's wrong.
here is the code
Our slider component will look like
<af:selectBooleanCheckbox label="Unit" value="#{PivotTableBean.dataValue}"
autoSubmit="true" />
The setDataValue() method in the backing bean will get a handle to AM and will execute the "filterVO" method in that, which takes the NumberRange as the input parameter.
public void setDataValue(boolean value) {
DataValue = value;
BindingContainer bindings = getBindings();
OperationBinding operationBinding = (OperationBinding)bindings.getOperationBinding("filterVO");
Object result = operationBinding.execute();
The filterVO method in the AMImpl.java will get the true or false and set the where Clause for the VO query to show values.
public void filterVO(boolean value) {
if (value != null) {
ViewObjectImpl ibVO = getVO1();
ibVO.setWhereClause("PRODUCT_TOTAL_REVENUE(+) where rownum < 10");
ibVO.executeQuery();
}Did you define a filterVO action in your pagedef.xml file?
You might want to read on how to access service method from a JSF Web Application in the ADF Developer Guide for 10.1.3 chapter 8.5 -
Assistance in comparing 2 Objects
I have got a problem... I am currently trying to compare 2 Objects together and checking upon their IDs and after that is done, it will then update the quantity of it... Below is my coding and hopefully, it will share some light on what I am trying to achieve...
[Bindable]
private var shopCartXML:XML = new XML(<product></product>);
[Bindable]
private var shopCartData:XMLListCollection;
private function addCart():void
var itemUpdate:XMLList = shopCartXML.product.(@category==musicTree.selectedItem.@category);
//var itemUpdate2:XMLList = shopCartXML.product.@id == musicTree.selectedItem.@id);
var testUpdate:Object = musicTree.selectedItem.@id;
for each (var item:Object in shopCartXML)
// 0 returns true, 1 and -1 for differences
var testItem:int = ObjectUtil.compare(item.product.@id, testUpdate, 0);
trace (testItem);
if ((testItem) && (itemUpdate.length() > 0))
itemUpdate.sing_quantity = Number(itemUpdate.sing_quantity) + 1;
else
var newData:XML =
<product id={musicTree.selectedItem.@id} category={musicTree.selectedItem.@category}>
<name>
{musicTree.selectedItem.@name}
</name>
<category>
{musicTree.selectedItem.@category}
</category>
<sing_price>
{musicTree.selectedItem.@sing_price}
</sing_price>
<sing_quantity>
{musicTree.selectedItem.@sing_quantity}
</sing_quantity>
</product>;
shopCartXML.appendChild(newData);
// We create the XMLListCollection as this will bring alot of functionalities like binding of data or update upon new changes
shopCartData = new XMLListCollection(shopCartXML.children());
Basically, I am trying to do is that after the the click of the button, it will come to this addCart function and within this function, it would firstly create a shopCartXML of XML and update the details into the shopCartData and it would be displayed into the data grid. But the real problem with this is that, I would want to validate on the product's id and its category. Because, at the moment, it will only validate on the category but not on the ID. Thus, when I have got 2 items of the same category but different IDs, it will only increase on the quantity of the 1st item, which I have added but it will not add the 2nd item to the data grid and it will only increase on the quantity of the 1st item....
I been working on this for 2 nights and still I have not managed to come up with a solution to solve this problem... Any ideas on where I am going wrong?? I tried my hands on ObjectUtil.compare and for each in loop but still I am not able to compare the shopCartXML ID and the Tree control selectedItem ID...Hi there, what is your issue?
Sincerely,
Michael
El 10/05/2009, a las 21:20, addytoe85 <[email protected]> escribió:
>
I have got a problem... I am currently trying to compare 2 Objects
together and checking upon their IDs and after that is done, it will
then update the quantity of it... Below is my coding and hopefully,
it will share some light on what I am trying to achieve...
>
private var shopCartXML:XML = new XML(<product></product>);
>
private var shopCartData:XMLListCollection;
>
private function addCart():void
>
var itemUpdate:XMLList = shopCartXML.product.
(@category==musicTree.selectedItem.@category);
//var itemUpdate2:XMLList = shopCartXML.product.@id
== musicTree.selectedItem.@id);
var testUpdate:Object = musicTree.selectedItem.@id;
>
for each (var item:Object in shopCartXML)
>
// 0 returns true, 1 and -1 for differences
var testItem:int =
ObjectUtil.compare(item.product.@id, testUpdate, 0);
trace (testItem);
>
if ((testItem) && (itemUpdate.length() > 0))
itemUpdate.sing_quantity =
Number(itemUpdate.sing_quantity) + 1;
else
>
var newData:XML =
<product
id={musicTree.selectedItem.@id}
category={musicTree.selectedItem.@category}>
>
<name>
{musicTree.selectedItem.@name}
</name>
>
<category>
{musicTree.selectedItem.@category}
</category>
>
<sing_price>
{musicTree.selectedItem.@sing_price}
</sing_price>
> -
Question about the Timer Objects
According to the API docs, the method Schedule for a Timer object takes the following constructor:
schedule
public void schedule(TimerTask task,
Date time)
Schedules the specified task for execution at the specified time. If the time is in the past, the task is scheduled for immediate execution.
Parameters:
task - task to be scheduled.
time - time at which task is to be executed.
Source: [link]http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimerTask.html[link]
However, I am getting the following error:
The method Schedule(TimerTask, Date) is undefined for the type Timer.
Any idea why I would be getting this message?However, I am getting the following error:
The method Schedule(TimerTask, Date) is undefined for
the type Timer.
Any idea why I would be getting this message?Yeah. Could be 2 things:
1. It's "schedule" not "Schedule" (case matters)
2. You're using java.sql.Data instead of java.util.Date. -
Hi,
I want to convert the date like 'now' to Time Object in a specific format ("yyyy-MM-dd hh:mm:ss")
I wrote the following code.
Time date;
date = (Time) 'now';
Time test = (Time) date.format(mask : "yyyy-MM-dd hh:mm:ss");
logMessage("Result: " + test);
Output is: Result: 2010-05-12 10:35:33+05:30
Here I do not want the +05:30 as I mask it in "yyyy-MM-dd hh:mm:ss" format.
BibhuIt's being overly helpful by including your timezone.
Try this instead. The display statement is just in there for debugging purposes. Take it out once you see you've got it working on your end.
Time myDate;
myDate = 'now';
String myTimeString;
myTimeString = myDate.format(mask : "yyyy-MM-dd hh:mm:ss");
display("Result: " + myTimeString);Dan -
Using expression to compare Calendar object
Hi,
I wonder if anyone has experience to use expression to compare Calendar object. Here is my case:
Application {
Calendar applicationDate;
What I want is something like:
expression.get("applicationDate").between(startDate, endDate);
But it is seems not working this way.
Any clue?
Thanks
HaoWhat error are you getting, in general this should work, however the Calendar will be printed/bound as a java.sql.Timestamp.
If you require to use java.sql.Date if you just want the date portion of the Calendar.
If your mapping for applicationDate sets the fieldClassification (i.e. is a TypeConversionMapping), then TopLink will automatically convert the Calendar value in the expression to the correct date type. -
hi all
i have a problem.
I want to compare two objects but dono how.
Object obj1=null, obj2=null;
Vector vec = new Vector()
obj1=vec
Vector vec1=new Vector()
obj2=vec
now i want to compare if(obj1 == obj2)
how can i do this
help out plzzzzzzzzzzzzzzzzz
thanxNope, I'm still scratching my head over this one.
However, there are two comparisions in java.
==, and .equals() method
== just checks to see if the Object is the same Object
.equals() is defined to check if one Object is equal to another.
quick example:
String s1 = new String("Hello");
String s2 = s1;
String s3 = new String("Hello");
String s4 = new String("GoodBye");
s1 == s2; // true because they are the same object
s1.equals(s2) // true because they have the same underlying value
s1 == s3 // false because they are different objects
s1.equals(s3) // true, because the are the same underlying value
s1 == s3 // false
s1.equals(s4)// also falseAny time you want to compare the VALUE of two objects, use the .equals method.
So in this case,
if (oldObj.equals(newObj)) is the way to go
If you are dealing with vectors/lists, the equals method will compare every item in oldObj with every item in newObj. If they are all equal, then it will return true.
Hope this helps,
evnafets -
How to compare two Objects !!!!
Hi All,
I know that this question has been asked 100 times till now. But trust me I have checked all of them but couldn`t find answer. Here is my question:
I have an objecs. In that object I am setting (Id,Name,DOJ). Now I want to check whether the object I am trying to save in database already exists or not. If exists then I need to check whether all the setters are same for the two objects. Now can anyone tell me ,how to compare two objects directly without comparing the setters individually.
Thanks in advance.pavan13 wrote:
That is pretty good idea. However I have a query. Does that code actually compare all the setters in a two beans. I don`t want to check each setter seperately.Well, it's pretty meaningless to talk about "comparing setters", setters are methods, they don't have values to compare. Because equals is inside the class, you can simply compare the fields that get set by the setters. "Properties" is probably a better name.
In principal you could write something that tried to find all relevant fields and compare them, using reflection or bean info stuff. The resulting code would be about 50 times longer and take about 50 times longer to run. It's hardly asking a lot to put three comparisons between && operators.
Remember, though, not to compare string fields with ==, you should call .equals on the string fields.
p.s. don't let the bean terminology confuse you. Beans are just ordinary objects which follow a few rules. Personally I wish the term had never been coined.
Edited by: malcolmmc on Dec 6, 2007 4:15 PM -
How to compare the object's properties
Hi ,
I have a requirement like to compare two objects data. But the object will have different types of parameters and it will have some other classes as properties. My utility has to compare for all the properties of the object including other classes properties which are included as properties in the main object also.
Can we achieve using java reflection this requirement.
If any one has idea reg this , plz help me.
thanks
Prakashhari_honey wrote:
No , actually i have to generate the change log of object data.
If any property of the object is changed and that has to go to the change log table with the
property name and old and new value.Sounds expensive and complex.
Presumably you can't change the code.
Presumably you can't provide a proxy layer.
Have you consider code injection?
Maybe you are looking for
-
How do I add a wifi repeater to my network
I am trying to add a repeater but the instructions are written for a PC
-
My apple tv connections is not working.
my apple tv connects than it will not show on the tv. When I try to connect again it says that the apple tv is already connected. When trying to connect it will show the same connect number over and over again but also say that it is already connec
-
Status of my Aperture Photobook order
I ordered a photobook from Aperture 3 weeks ago and wanted to find out the status of my photo book order in the UK, and I can't find a number to contact. Any suggestions from anyone who to contact?
-
"DVD DECODER NOT PRESENT" in Lombard 400mhz G3?
I recently bought a Lombard 400mhz G3 Powerbook online which plays DVD'S fine in OS9. However my freind as since bought the same model - 400mhz 1mb cache DVD Rom etc but his won't play DVD'S in OS9 at all. The system profiler says "DVD DECODER NOT PR
-
Index/constraints source code view
In what table or view I can see the all sources code of the all constraints and index of the tables?