Exist a class for Convert any data to miliseconds?
Hi!
I now how to convert current day data to miliseconds, but I don't now how to do it with other data's?
If it exists what was the format?
If someone now, could post here the code?
Thanks
Hi!
What you told me was right, but something wrong was happening, look to my results:
Milis :: 1021735555115
TIME :: 16:27:34:235
TIME in MILLISECONDS :: 1019143654235
And here is the code!!!
int d = 18;
int m = 4;
int y = 2002;
int hr = 16;
int mn = 25;
java.util.Calendar c = java.util.Calendar.getInstance();
c.set(y,m,d,hr,mn,55);
long milli = c.getTimeInMillis();
System.out.println("Milis :: " + milli);
Calendar now = Calendar.getInstance();
int hour = now.get(Calendar.HOUR_OF_DAY);
int min = now.get(Calendar.MINUTE);
int sec = now.get(Calendar.SECOND);
int millis = now.get(Calendar.MILLISECOND);
System.out.println("TIME :: " + hour + ":" + min + ":" + sec + ":" + millis);
long baseTime = now.getTimeInMillis();
System.out.println("TIME in MILLISECONDS :: " + baseTime );
The current hour is 16:28 and what I put in your test is 16:25
and in milliseconds 16:25>16:28 !
:( I don' t understand ...
Thanks
Andreia
Similar Messages
-
Which Function Module is used for converting the DATE in BDC
HI,
Which Function Module is used for converting the DATE Format in BDC for Uploading purpose please help me.data : date like sy-datum.
data : odate(10) type c.
date = sy-datum. " in format YYYYMMDD
CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
EXPORTING
input = date
IMPORTING
OUTPUT = odate .
write:/ odate. "in ur format '.
1.
In ur itab make a field for date as 10 characters and use this Fm to store the date .
2. Pass the date as the charcter field to the screen and now check . -
How to convert "any" date format to internal format
Hi,
I want to convert any date format to internal format. Is there any function module ?
The date formats could be:
DD.MM.YYYY
MM/DD/YYYY
MM-DD-YYYY
YYYY.MM.DD
YYYY/MM/DD
YYYY-MM-DD
Thank you,
SuryaHi,
Check this sample program..It will convert sap supported external format to the internal format..
PARAMETERS: v_char(10).
DATA: v_date TYPE sydatum.
DATA: v_period TYPE usr01-datfm.
Get the format.
DD.MM.YYYY
IF v_char+2(1) = '.'.
CONCATENATE v_char6(4) v_char3(2) v_char(2) INTO v_date.
ENDIF.
MM/DD/YYYY
IF v_char+2(1) = '/'.
CONCATENATE v_char6(4) v_char(2) v_char3(2) INTO v_date.
ENDIF.
MM-DD-YYYY
IF v_char+2(1) = '-'.
CONCATENATE v_char6(4) v_char(2) v_char3(2) INTO v_date.
ENDIF.
YYYY.MM.DD
IF v_char+4(1) = '.'.
CONCATENATE v_char(4) v_char5(2) v_char8(2) INTO v_date.
ENDIF.
YYYY/MM/DD
IF v_char+4(1) = '/'.
CONCATENATE v_char(4) v_char5(2) v_char8(2) INTO v_date.
ENDIF.
YYYY-MM-DD
IF v_char+4(1) = '-'.
CONCATENATE v_char(4) v_char5(2) v_char8(2) INTO v_date.
ENDIF.
WRITE: / v_date.
Thanks,
Naren -
Converting any date string to GMT standard
Hi All,
I want to convert any date string to GMT standard.
The date string may be like this.
"Sat Sep 15 14:23:40 IST 2001"
I have tried to change my defaultTimeZone .
But I don't know why it's not working.
Is there something to do with Locals?
Can anyone please tell me the way to
accomplish that ?
Thanks in advance.
SujoyJava stores all the dates in GMT Format , considering the machines TimeZone Setting ....and also i guess date has methods like toGMTString() and toLocaleString() . To convert the date to GMT i guess u can just say toGMTString() of the date . If u have the stringified version of date
just make a new Date(String) and then calling toGMTString of it . -
How to convert any date format to default US format using javascript???
Hi,
I was trying to convert a date format to default US date format. The date format will vary according to different regions (It can be dd/MM/yyyy or MM/dd/yyyy or yyyy/dd/MM or any). I need to convert it in to MM/dd/yyyy always (US Format). Please give some
solutions for the same.
Warm Regards,
Tony Joyhi
it is not trivial task in common case. We faced with similar issue when tried to localize date times in display templates in Sharepoint 2013 depending on site's locale, which can be done only via javascript. In order to do it you need to add date time locale
information from server side to client side, e.g. by defining global variable. See the following article for details:
Localize datetimes in display templates in Content by search web parts in Sharepoint 2013. I extended OTB global object _spPageContextInfo with new property (as far as I remember this object is also available in Sharepoint 2010):
<script type="text/javascript">
jQuery(function() {
if (typeof (_spPageContextInfo) != "undefined" &&
_spPageContextInfo != null) {
<%
var ci = new CultureInfo(1033);
var cultureSerialized = new JavaScriptSerializer().Serialize(
new
name = ci.Name,
dateTimeFormat = ci.DateTimeFormat,
numberFormat = ci.NumberFormat
%>
_spPageContextInfo.currentCultureSerialized = <%= cultureSerialized %>;
</script>
Having different date time formats for your locale, you may use
Date.localeFormat function from MS Ajax for formatting the date in specific format. If in your case format is predefined you may hardcode it without adding DateTime formats from server side.
Blog - http://sadomovalex.blogspot.com
Dynamic CAML queries via C# - http://camlex.codeplex.com -
Cannot load required classes for service SLD Data supplier
Hello Experts,
I am trying to use the SLD Data supplier service from visual administartor for registering my DEV EP 7.0 engine in central SLD.When am trying to access that particular service from visual admin,it is throwing an error saying that:"Cannot load required classes for SLD Data Supplier service and please refer the not for resolution Note No:1017526.
My NW EP 7.0 is at SP17 level and as per the above note all settings are fine and the relevant application is also started well.
Please suggest us for any possible solution.
Thanks&Regards,
Apparao S.> You can also try the following: Move sldserv.jar from
> /usr/sap/<SID>/<InstID>/j2ee/cluster/server0/bin/services/sld/
> to
> /usr/sap/<SID>/<InstID>/j2ee/admin/lib/
Hi Desiree,
Thanks, worked for me too.
Only in my case, when I moved the file, the sld data provider service did not start at all after reboot of the instance.
Also, the sap.com/tcsldwd~main application refused to start.
I then copied the file back, this time maintaining an entry in both locations and reboot the instance. Everything started working after I reboot the instance. The error also disappeared and I was able to change the SLDuser password.
Thanks
Prasad -
Function module for converting German Data/Time to Indian Date/Time
Dear All,
My requirement is to convert German date and time to Indian date and time. Is there any function module available or any way we can get it?
Thanks and regards,
Atanuhi,
first get the timezone of that country
CALL FUNCTION 'TZON_LOCATION_TIMEZONE'
EXPORTING
if_country = p_it_userid-zcountry
IMPORTING
ef_timezone = l_tzone
EXCEPTIONS
no_timezone_found = 1
OTHERS = 2.
then use the below statements
-- Convert from server time to GMT
CLEAR l_tstmp.
CONVERT DATE l_datum
TIME l_ctime
INTO TIME STAMP l_tstmp TIME ZONE sy-zonlo.
*-- Convert from GMT to user backup time
CONVERT TIME STAMP l_tstmp TIME ZONE it_usr_timezone-ztzone
INTO DATE it_usr_timezone-zdate
TIME it_usr_timezone-ztime. -
ABAP statement for converting UTC date/ time to local date/time
Hi
Is there any abap statement or any function module in BW which converts UTC date and UTC
time into local date and local time according to specific country.
Regards,
KateHi,
and to convert the country to a timezone first use: TZ_LOCATION_TIMEZONE
/manfred -
Is there an efficient wrapper class for reading binary data in cocoa/iPhone
Hi,
I need to read a data from a binary file in my iPhone application. What is the best way to do it? Is there an efficient cocoa wrapper class for this purpose?
Thanks,
NavaA char is a 16-bit unsigned value - depending on what you want, it may help.
I don't understand your reluctance to mask off the upper 16 bits of an integer; all it requires is a single bitwise 'and' statement. I challenge you to measure the impact of such a statement on your program. -
How to develope application for converting excel data into oracle database
I am very new to the oracle world. I want to develop application for converting excel sheet into oracle database using oracle forms. I have basic knowldge of oracle but i am totally new to the forms. Can anybody tel me step by step procedure to do this task? Please help me out in this problem.
Thanx in advance.Hello,
just do a "Search" in this forum with words "excell to oracle"... and you could find lot of posts about that, i.e.:
Re: How to load excel-csv file into oracle database
Jose L -
How to convert any date format?
Hi,
In the BPEL process I am getting the input in 'DD-MON-YYYY' format, I want to convert it to 'DD-MM-YYYY' format.
The function xp20:formatDateTime('string', 'image') expecting the string to be in 'YYYY-MM-DD' format. and the 'image' can be set to any format.
So i am able to convert to any format if I have the input string in 'YYYY-MM-DD' format, if I get in different format then how do I change them to required format?
--KhaleelLooks like you are sending the date in Oracle format. If the date is created by a DB adapter the date should be formated in the correct format for BPEL to format (YYYY-MM-DDTHH:MI:SS). To make sure this happensyour xml needs to be the date data type and the value sent maust be a date not a string, if it is a string use the to_date to make it a date field.
You are correct once it is in the YYYY-MM-DD format you can change to any format.
cheers
James -
Defining classes for an acquisition data application
Hi, all.
I'm working on an acquisition, monitor and control application. I use a wide variety of devices like GPS, total stations, IMUs and others that aren't defined yet. A low level data acquisition algorithm written in C++ has already been implemented for each device type. The acquisition data stream wouldn't be continuous, but only one data read every a certain period of time.
I want to use LabView for the main application of monitor and control, but I don't know exactly how to communicate with the devices. I want to create a general purpose application, independent from the number and type of devices used.
- Could I define a "device" class, and manage every device defining class properties and methods?
For each "device" object, every method would perform the acquistion data functions written in C++. So,
- Could I define methods that would call to C++ functions?
Hope you can help me.
Thanks in advance,
FranciscoWhat kind of acquisition
device are you going to use? Multifunction cards or more specific HW? This
hardware is from National Instruments?
If you are using NI
hardware, you have to use NI drivers that are OO drivers with properties and
methods already defined and generic for all HW of his family. These drivers have
support for C and LabVIEW.
In addition, LabVIEW can
call C methods via DLLs using the VI "call library function node" Do
you know how to use this VI? -
Classes for converting a flat file to XML
I've been asked to convert text in a flat file to an XML document. The XML document must conform to an XML schema. Currenlty, there is no requirement to store the resulting xml in the database.
Therefore my approach will be:
1. parse the flat file and store the contents in an array (the flat file and target xml is fairly simple in structure)
2. Transfer the contents of the array to the xml structure
3. validate the xml against the schema
I'm new to Java. Therefore, what classes should I be using to assist in step 2. Obvoiusly, I dont want to have to write my own implementation from scratch (i.e. a method to build an element, method to escape reserved characters etc).
Could you please suggest classes that cover both DOM and SAX API's.
I'm working with a 9.2.0.4 database and XDK.
ThanksThe Stylus Studio may be used to convert text file to XML.
http://www.stylusstudio.com/text_file_to_xml.html
Another reference:
http://www.devx.com/getHelpOn/10MinuteSolution/20356 -
Modifying existing style selectors for selected components
Hi,
We have changed default .AFNoteWindow,AFNoteWindowRight style class for one use case. But it is applying for other use cases also where we are showing user friendly messages. how we can avoid the applying style for other use cases? and these all are existing selectors and we cannot create new one for this.
Thanks
KuladeepHi,
Could anybody help me on this?
Here i am giving more details about issue which we are facing. we have override following CSS class in our skin CSS file .AFNoteWindow,.AFNoteWindowRight,.AFNoteWindowConeTR,.AFNoteWindowConeBR,.AFNoteWindowConeBL,.AFNoteWindowCone,.AFNoteWindowConeBorder,.AFNoteWindowConeBorderRight for one of the use case (showing help text in the popup when mouse over on help icon ).
We have another use case where we are showing help message when user is put his mouse in date field. Here also we are able to see above CSS effects but it should not.
Please help me how I can override existing CSS class for specific use case or writing my own CSS class which will give same look and feel
Thanks
Kuladeep.K -
For a given date required last week day
Hi Friends,
Is there any function module exists if I will enter any date as input parameter
the last thursday date should come as output ?
For example 1: The input parameter is 15.04.2009 (15th is Wednesday) so the output is 09.04.2009(bcz last thrusday is 9th)
2. Suppose if the input parameter is 17.04.2009 (17th is friday) so the output is 16.04.2009(bcz last thrusday is 16th)
Thanks
RajHi ,
You can use the following code:
data : v_date type datum,
v_day(10) type c.
v_date = pass whatever date you want in format yyyymmdd .
do .
CALL FUNCTION 'DATE_TO_DAY'
EXPORTING
date = v_date
IMPORTING
WEEKDAY = v_day
if v_day <> 'Thursday'.
v_date = v_date - 1 .
else.
write: v_date .
exit.
endif.
enddo.
Regardrs,
Ashish Arora
Maybe you are looking for
-
How can I replace my internal hard drive on my Macbook?
I have a 13 inch aluminum late 2008 MacBook. The processor is 2 GHz Intel Core 2 Duo, Memory 4 GB 1067 MHz DDR3 running OS X Lion 10.7.4. The hard drive is currently set up as follows: Macintosh HD 132.5 GB (with only 1.32 GB free) BOOTCAMP 26.69 G
-
Print text in Bold while creating PDF
Hi, I am mapping data in the XML to a Template designed using LiveCycle Designer ES3. I need to print some of the text in BOLD. For exmple in the following XML, when we display the text in PDF, person names should be in BOLD. Part of the XML that is
-
Autonomous 1252 converted to CAPWAP will not join 5508 WLC
WLC 5508 firmware is v6.0.188.0 I've tried updating the autonomous 1252 via both the upgrade tool 3.4 and 'archive download-sw' from the CLI I've tried multiple recovery images c1250-rcvk9w8-tar.124-21a.JA2.tar c1250-rcvk9w8-tar.124-10b.JDA.tar After
-
I'm creating a new user from the transaction SU01. Which profile do I have to choose for being able to access to all transactions?
-
This is my first try - I managed to upload my new website onto the server (netpark.net, not .Mac), but then needed to change one of the photo files. I somehow broke the link between the thumbnail and the full-size image. I've redone the iWeb file twi