How to check the current time with a Stored time in string format
Hi All
I would like to compare the system time with an existing time values which is allready there in String format..
i mean i would like to check if the SysTime is inbetween 6:30 and 14:00
I accomplished this in Oracle ..
Select 'Y' from dual where to_date(to_char(sysdate,'HH24:MI '),'HH24:MI') between to_date('06:30','HH24:MI') and to_date('14:00','HH24:MI')
But instead of checking the DB each and every time , the perfomance would be better if we can do this in our java code..
Could some one provide me with a code to accomplish the above scenario..
Thanks in advance..,.,
import java.util.Calendar;
Calendar rightNow = Calendar.getInstance(); // gets the current date and time to millisec
Calendar earlyTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 6).set(Calendar.MINUTE, 30);
Calendar lateTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 8).set(Calendar.MINUTE, 0);
if (rightNow.compareTo(earlyTime)> 0 && rightNow.compareTo(lateTime) < 0){
// do something
}Try this.
Similar Messages
-
How to check the current EHP stack level? in SAP
Dear All,
How to check the current EHP stack level? in SAP . i have checked forum before i am posting but still comfused .
same one said SAP_APPL , EA_Appl and SAP _HR is 60n if n=1.2.3.4. if n =1 is enhanced package 1 similarly 2,3,4 .
some one said SAP_BASIS 701,702,703,704 . according ehp1,2,3,4.
Pls check the details and confirm either is ehp1 or ehp4 .
Component version is simply shows SAP ECC 6.0 in system -> status.
Software Component - Release - SP level
SAP_ABA 701 0007
SAP_BASIS 701 0007
PI_BASIS 701 0007
ST-PI 2008_1_700 0003
SAP_BS_FND 701 0008
SAP_BW 701 0007
SAP_AP 700 0021
WEBCUIF 700 0008
SAP_APPL 604 0008
SAP_HR 604 0029
SAP_HRCAR 604 0029
SAP_HRCAT 604 0029
SAP_HRCAU 604 0029
SAP_HRCBE 604 0029
SAP_HRCBR 604 0029
SAP_HRCCA 604 0029
SAP_HRCCH 604 0029
SAP_HRCCL 604 0029
SAP_HRCCN 604 0029
SAP_HRCDE 604 0029
SAP_HRCDK 604 0029
SAP_HRCES 604 0029
SAP_HRCFI 604 0029
SAP_HRCFR 604 0029
SAP_HRCGB 604 0031
SAP_HRCHK 604 0029
SAP_HRCID 604 0029
SAP_HRCIE 604 0029
SAP_HRCIN 604 0029
SAP_HRCIT 604 0029
SAP_HRCJP 604 0029
SAP_HRCKR 604 0029
SAP_HRCMX 604 0029
SAP_HRCMY 604 0029
SAP_HRCNL 604 0029
SAP_HRCNO 604 0029
SAP_HRCNZ 604 0029
SAP_HRCPH 604 0029
SAP_HRCPT 604 0029
SAP_HRCRU 604 0029
SAP_HRCSE 604 0029
SAP_HRCSG 604 0029
SAP_HRCTH 604 0029
SAP_HRCTW 604 0029
SAP_HRCUN 604 0029
SAP_HRCUS 604 0029
SAP_HRCVE 604 0029
SAP_HRCZA 604 0029
SAP_HRGXX 604 0029
SAP_HRRXX 604 0029
EA-IPPE 400 0018
EA-APPL 604 0008
EA-DFPS 600 0018
EA-FINSERV 604 0007
EA-GLTRADE 604 0008
EA-HR 604 0029
EA-HRCAR 604 0029
EA-HRCAT 604 0029
EA-HRCAU 604 0029
EA-HRCBE 604 0029
EA-HRCBR 604 0029
EA-HRCCA 604 0029
EA-HRCCH 604 0029
EA-HRCCN 604 0029
EA-HRCDE 604 0029
EA-HRCDK 604 0029
EA-HRCES 604 0029
EA-HRCFI 604 0029
EA-HRCFR 604 0029
EA-HRCGB 604 0029
EA-HRCHK 604 0029
EA-HRCID 604 0029
EA-HRCIE 604 0029
EA-HRCIN 604 0029
EA-HRCIT 604 0029
EA-HRCJP 604 0029
EA-HRCKR 604 0029
EA-HRCMX 604 0029
EA-HRCMY 604 0029
EA-HRCNL 604 0029
EA-HRCNO 604 0029
EA-HRCNZ 604 0029
EA-HRCPH 604 0029
EA-HRCPT 604 0029
EA-HRCRU 604 0029
EA-HRCSE 604 0029
EA-HRCSG 604 0029
EA-HRCTH 604 0029
EA-HRCTW 604 0029
EA-HRCUN 604 0029
EA-HRCUS 604 0029
EA-HRCVE 604 0029
EA-HRCZA 604 0029
EA-HRGXX 604 0029
EA-HRRXX 604 0029
EA-PS 604 0007
EA-RETAIL 604 0007
FINBASIS 604 0008
ECC-DIMP 600 0018
ERECRUIT 604 0008
FI-CA 604 0008
FI-CAX 604 0007
INSURANCE 600 0018
IS-CWM 600 0018
IS-H 600 0024
IS-M 600 0018
IS-OIL 600 0018
IS-PS-CA 604 0007
IS-UT 600 0018
LSOFE 600 0018
SEM-BW 604 0008
ST-A/PI 01M_ECC600 0001
Regards
Edited by: satheesh0812 on Nov 17, 2011 7:57 AMHi Sateesh,
SAP_ABA 701 0007
SAP_BASIS 701 0007
PI_BASIS 701 0007
ST-PI 2008_1_700 0003
SAP_BS_FND 701 0008
SAP_BW 701 0007
SAP_AP 700 0021
WEBCUIF 700 0008
SAP_APPL 604 0008
Based on the component information provided by you, I can conclude that your system is ECC 6.0 EHP4.
EHP4 is derived from your component SAP_APPL 604.
In addition to this your EHP4 system has NW stack on NW 7.0 EHP1.
Hence your system is ECC 6.0 EHP4 with NW 7.0 EHP1.
Hope this answers your query.
Regards,
Deepak Kori -
How to check the current open period
Hello ABAP Gurus,
Could you help on how to check the current open period...
Sample would be
current date = may 1, 2009 but period for may is not yet open
so open would be april period
Thanks in advance....
Edited by: nanz ruiz on May 27, 2009 3:34 AMHi,
Check the fieldas FRYE2,FRPE2,TOYE2,TOPE2 of table T001B for a given varient.
Regards
Vishnu Gupta -
Q: How to retrieve the current URL with PL/SQL
I've got a pair of dynamic page portlets on a page. The first is simply an input text box and a submit button, the second is an inventory 'report' based on what is entered in the text box. When a value is entered and the button pressed, there is javascript behind the button that takes the current URL, adds '&ITEM=XXXXXXXX' (removing it first if this is not the first invocation of the page), and redirects to the new page.
The second portlet uses the &ITEM parm to list a bill of materials for the item. If one of the items possesses a sub-assembly, I want to display the item# in an <a href= manner to make it so the user can simply click on the link to see the BOM of the subassembly.
To do this, I believe I need to capture the current url and modify it as required to pass the new &ITEM value. I'm having a lot of trouble trying to figure out how to get the current page url. Any help would be greatly appreciated!
GeoffHello
I have a similar problem I have developed a pl/sql portlet and put it into a page, this portlets display a dynamic page. This dynamic page have a search functionality, what I am trying to do is that when I click the search button on the dynamic page it recall the whole page and pass the paremeter that the user wrote on the search box, then the portlet that contains the dynamic page recieve the parameter and recall the dynamic page with the parameter that was received. The problem that I have is that the portlet receive the parameter but when I pass the parameter to the dynamic page it doesn't get it. This is the way the I am calling the dynamic page inside my portlet into the show procedure:
EXECUTE IMMEDIATE
'begin
APP_NAME.PG_DYN_DIR_ALFABETICO.show (
p_arg_names => PORTAL30.wwv_standard_util.string_to_table2(''url_page'',''search_param''),
p_arg_values => PORTAL30.wwv_standard_util.string_to_table2(:1,:2));
end;'
using url_pg,p_text1;
The dynamic page receive the first parameter(url_page) but not the second one(p_text1), I have checked that the p_text1 has a value on my portlet before I send it to the dynamic page so I really don't understand why my dynamic page doesn't work.
Please HELP ME. I am desperate
Ana Lasprilla -
How to check the current networks on receiver with SHAREit?
1. Launch SHAREit and click Receive; 2. The page will change to "Waiting to receive", and click the "Friends cannot find you?" button; 3. The "Current networks" will pop up, as follows: .lan .EjrpN-........etc.
For the most part, sender can find receiver automatically. Under narrow cases, sender may need to join the same network as receiver.
-
How to handle the current row with radio button selection???
Hi Everyone,
I have one ADF page with one table and one "Find" button.
I have created one new attribute with VARCHAR2(1) in the VO and dragged that attribute as first column in the table. And changed that first column to Radio Button to select only one row at a time.
Upon clicking on the "Find" button i need to get the values of current selected row.
How can i get the values of selected row?
What code should i write to get the values of selected row in Method Binding of "Find" button?
Any suggestions will be really useful.
Thanks.Hello Kumar,
I have some comments on your case.
>
I have created one new attribute with VARCHAR2(1) in the VO
>
1- You should create this attribute in the Entity object and then add it to the view object.
2- Do you need that only one radio button is set at a time for all rows ? If yes then you need to handle the case when the user set more than one row and clear the value of the attribute for all other rows.
>
How can i get all the values of current row in backing bean method(method binding of Find method)?
can u plz provide me the code for that?
>
If you mean by the current row is that the row with its value of the selected attribute is set (the radio button is set for that row), then you can write a method in the viewObjectImpl class and expose it to client interface and call it from your bean.
here is an example based in Department table in HR schema.
//This method is written in DepartmentsViewImpl
public Row getSelectedRadioRow(){
//create a second row set to not impact the row set used in ADF
RowSet duplicateRowSet = this.createRowSet("duplicateRowSet");
//get the current row of the table to set it back after re-executing the VO
DepartmentsViewRowImpl currentRow = (DepartmentsViewRowImpl)this.getCurrentRow();
Row[] filteredRows = duplicateRowSet.getFilteredRows("IsSelected", "1");
DepartmentsViewRowImpl row=null;
if(filteredRows.length>0){
row = (DepartmentsViewRowImpl)filteredRows[0];
System.out.println("Department Name " + row.getDepartmentName());
this.setCurrentRow(currentRow);
duplicateRowSet.closeRowSet();
return row;
} -
HOW TO CHECK THE CHECKBOX VALUE WITH SQLCE DATABASE
Hai All,
Good Day! I am using VB in Visual Studio 2008. I have a form with check boxes and one button control. If i selected the check box and then click the button, check the database table field and check box text are equal. if both are equal then
how to check?
I have tried it. The code is:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conn As New SqlCeConnection
Dim cmd As New SqlCeCommand
conn.ConnectionString = "DataSource = E:\Vbprojectex\WindowsApplication3\WindowsApplication3\Database1.sdf"
Try
cmd.Connection = conn
conn.Open()
If CheckBox1.CheckState = 1 Then
cmd.CommandText = "SELECT Aerator FROM ttabpagelist where Aerator = CheckBox1.Text"
TextBox1.Text = 1
End If
cmd.ExecuteNonQuery()
Finally
conn.Close()
End Try
End Sub
End Class
Thanks & Regards Sasi ................. Go Greenprobably something like (ofc below will never give result since Aerator can't have 2 values, you will have to adjust the second check box column obviously)
Try
cmd.Connection = conn
conn.Open()
dim strsql as string = "= "SELECT Aerator FROM ttabpagelist "
Dim whereConcatenator As String = " WHERE "
Dim Wherestatement As String = String.Empty
If checkbox1.checked = True Then
Wherestatement += whereConcatenator
Wherestatement += "Aerator = " & checkbox1.Text
whereConcatenator = " AND "
End If
If checkbox2.checked = True Then
Wherestatement += whereConcatenator
Wherestatement += "Aerator = " & checkbox2.Text
End If
cmd.commandtext = strsql & wherestatement
TextBox1.Text = 1
End If
cmd.ExecuteNonQuery()
Finally
conn.Close()
End Try -
How to check the integer value with Date Column
Hi Friends,
I have a filter called 'Days'. I need to show the data based on the Days filter (Example : 2 Days).
Example Query:
Select * from Tb1
Where EndDate(Value as '03/05/2013' > Days ( value as 2)
How to handle the above scenario.
Thanks in Advance....
Regards,
LuckyAbdulwhat meanings does it make. how can you compare a date to day count. Or is the inetger value an offset ie say 2 days from today etc?
If yes you can use like below illlustration
DECLARE @DayOffset int
SET @DayOffset = 2
SELECT *
FROM TAble
WHERE ENdDate >= DATEADD(dd,DATEDIFF(dd,0,GETDATE()),@DayOffset+1)
refer
http://visakhm.blogspot.in/2010/01/some-quick-tips-for-date-formating.html
Please clarify with an example what you're expecting if its different from the above.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How to find the current User Name and stored in which table
In which table the current user name (Login) is stored?
Hi Mohanapriya
The query provided by Gordon can not run on query generator as the $USER is a runtime variable.
You need to save it to a query then use it in a FMS(Formatted Search.)
Just open a form(ex:sales order ), click the field in which you want to show the user name,
then press ****+F2 or Tools->Search Function->Define,
Search by Saved query,then assign the save query to the field.
After that ,you can run the FMS(shift+F2) to get the current user info.
Regards,
Syn Qin
SAP Business One Forums Team -
How to Get the Current Workitem id at runtime
Hi All,
I have a scenario, where request pending with a user who has already resigned the organization. The requirement is that we need to provide a report
of the request and with whom it is pending with along with the workitem id with a forward push button.
So that if the user identifies that a request is pending with someone he can click the record and press for the forward button and a pop-up to be showed where he can enter the userid to whom he needs to forward it.
In this scenario can anyone tell me how to get the current workitem id at run time and to save it to a custom table.
I tried with method before workitem execution, but here i am not getting the current workitem id.
Can you please suggest a good solution for this.
Thanks and Regards,
BalajiKarri,
I think i can explain you with an example.
Here is my Scenario.
A user has raised a Gate pass and it went to all approval's and got approved and the material is also sent out from the plant. Lets take the date as 1.1.2013 (A Warehouse person have done the checking and sent out of the plant).
On 1.3.2013 some of the material has been returned and a material inward request has been raised and now the warehouse person has to do a inward checking and to sent it back for the initiator for the approval, but the warehouse person has resigned the organization on 1.2.2013, now the workitem is pending with the warehouse person who has already resigned.
My scenario is once the material inward request is created and before the workitem is delivered to the warehouse person i need to get the workitem id and to store the workitem some where.
So that in future if any warehouse dept head wants to forward the workitem which are lying in the person inbox who has already resigned he can do it via a report using this workitem id.
So, can anyone help how to get the dialog workitem id before the workitem creation or execution. I tried with "method before workitem execution" but my break point is not triggering at this point.
Thanks and Regards,
Balaji -
How to get the current date and compare dates
hi
does anyone know how you would get the current date?
furthermore, how to compare the current date with a past date to see how many days or months have past since then?
thankshave a look at the Date class. new Date() creates an object containing the exact date and time at creation time. (Date).getTime() might be useful for comparing two dates. GregorianCalendar might be useful, too.
-
How to cooperate the current mail system with Sun Java Commnication Suite 5
Dear all and Shane,
Excuse me for bothering you again.
Due to time limited, I would like to know how to cooperate the current mail system with Sun Java Commnication Suite 5. I mean I would like to use current mail system (mailscanner + postfix + courier-IMAP + clamav + spamassassin + webmail) and use the outlook connector to connect to Sun Java COMMS 5 to share the calendar, contacts only.
Right now I have done the testing by using outlook, mac mail, thunderbird to share calendar,contacts via Sun Java COMMS 5 in Centos Linux 5.
My plan is as following
1. Sun Java Communication suites 5 server ( I called it comms5 ) will be in DMZ zone and will open the necessary ports in firewall.
2. I will create more than six sub domain name in Sun Delegate server and the necessary accounts within these domain names.
3. All messages will be transmitted via Postfix and clients will retrieve from Courier-IMAP
4. All Clients included other branch offices will use different mail clients to share their calendars, contacts via COMMS5 ( But how will COMMS handle the messages such like invitation ? )
Any suggestions will appreciate.
PS: Is it possible to classify the contacts in outlook address book ?
For example, when user click the receiver, it will show like as following
GLOBAL ADDRESS BOOK
--Director
--and so on
----CN.BRANCH OFFICE
-----------CN01 EMAIL ADDRESS
-----------CN02 EMAIL ADDRESS
-----------CN03 EMAIL ADDRESS
and so on
----JP.BRANCH OFFICE
-----------JP01 EMAIL ADDRESS
-----------JP02 EMAIL ADDRESS
-----------JP03 EMAIL ADDRESS
and so on
----TW.BRANCH OFFICE
and Due to the user account is located in CN.BRANCH OFFICE, it will extend the CN.BRANCH OFFICE contacts level.
Excuse me for bad English, hope you can understand it.
Best Regards,
BruceDogz wrote:
Due to time limited, I would like to know how to cooperate the current mail system with Sun Java Commnication Suite 5.
I mean I would like to use current mail system (mailscanner + postfix + courier-IMAP + clamav + spamassassin + webmail) and use the outlook connector to connect to Sun Java COMMS 5 to share the calendar, contacts only.Getting your current mail system to 'co-operate' in this way will require more time then simply migrating the accounts of users on the current mail system to the comm-suite-5 installation and making use of UWC for Webmail access and ClamAV/SpamAssassin integration within the messaging MTA.
Also the use of Outlook Connector with a non-Sun IMAP backend isn't supported, nor is the use of a non-Sun IMAP backend possible with UWC.
Right now I have done the testing by using outlook, mac mail, thunderbird to share calendar,contacts via Sun Java COMMS 5 in Centos Linux 5. Once again I should remind you that CentOS is not a supported platform for comm-suite-5
Regards,
Shane. -
How to check the compilation time of C++ code on Xcode 6
how to check the compilation time of C++ code on Xcode 6
import java.util.Calendar;
Calendar rightNow = Calendar.getInstance(); // gets the current date and time to millisec
Calendar earlyTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 6).set(Calendar.MINUTE, 30);
Calendar lateTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 8).set(Calendar.MINUTE, 0);
if (rightNow.compareTo(earlyTime)> 0 && rightNow.compareTo(lateTime) < 0){
// do something
}Try this. -
Help--how to check the exact time?
Pls help me:
How to check the accurate down-time when the Sun machine (with solaris 8 sparc) abnomally shutdown (eg. power failure)?
or
Is there any way to detect the exact time when I shutdown the Sun machine ?
thanks.check /var/adm/messages ; uptime ; last ..
there are quite a few method u can use -
How to get the current GMT time in java
Hi,
How to get the current GMT time in java
ThanksSystem.getCurrentTimeMillis() or new Date().
[url http://www.javaworld.com/jw-12-2000/jw-1229-dates.html]Calculating Java dates: Take the time to learn how to create and use dates
[url http://www.javaalmanac.com/egs/java.text/FormatDate.html]Formatting a Date Using a Custom Format
Maybe you are looking for
-
I can't begin to describe this, firefox opens to websites and I don't know why
PLEASE HELP I never had issues with this browser which I use almost exclusively. Now over the past week, I am having nothing but. I have windows 7 pro 64 bit. Once again, I uninstalled and reinstalled firefox after it seemed to be going haywire. I se
-
Duplex Printing in MS Powerpoint - Margins Aren't Aligned
I solved my own problem, but now can't figure out how to delete this post. So, please ignore. I have the HP Photosmart Premium, running Win XP. I created a document in MS Powerpoint 2010 that is two sided, with four copies per page. (There are f
-
Hi, Hope this is in the right place. I'm trying to upload photos into facebook from my iMac. I've clicked on the upload to facebook icon in iphoto but just get an error message saying 'error occurred with iPhoto - try again later. I've also had probl
-
OVD plugin returning "Virtual" entry when entry not yet available in OID
Hi, We've been working on a solution in which a new user has to get immediate access to a website and we, because the provisioning is taking some time, we have implemented a plugin for OVD which basically looks in the OID and if the user exists in OI
-
Why are previews in Adobe RGB (1998) ?
In experimenting with emailing previews from Aperture I noticed they were washed out when displayed on the Windows PC that received them. I dragged a preview to the Mac desktop and choose "get info" to see that the Profile Name is Adobe RGB (1998) If