Convert Milliseconds into specified format
HI,
How to convert System.currentMillis() into yyyy-mm-dd HH:MM:SS:SSS format?
PLease give me a solution
Thanks
Use
long currTime = System.currentTimeMillis();
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(currTime);
System.err.println(cal);
LOL, have you run this codez? For me, it outputs:
java.util.GregorianCalendar[time=1176827393171,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/Los_Angeles",offset=-28800000,dstSavings=3600000,useDaylight=true,transitions=185,lastRule=java.util.SimpleTimeZone[id=America/Los_Angeles,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2007,MONTH=3,WEEK_OF_YEAR=16,WEEK_OF_MONTH=3,DAY_OF_MONTH=17,DAY_OF_YEAR=107,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=9,HOUR_OF_DAY=9,MINUTE=29,SECOND=53,MILLISECOND=171,ZONE_OFFSET=-28800000,DST_OFFSET=3600000]
Similar Messages
-
How to convert Milliseconds into Date format
Hi all,
I am getting the output of a variable in milliseconds format, how can I convert it into date format
For ex: I am getting input variable as 1366664691000 and I need to convert it to April 22, 2013 5:04:51 PM EDT ( or of SOA format). is there any function for this in XSL or XPath?
Thanks,It is working fine if i test it in provided site...
But it is returning "-1366664691001", If i am running it in EM. This is the code in my xsl
<?xml version="1.0" encoding="UTF-8" ?>
<?oracle-xsl-mapper
<!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
<mapSources>
<source type="WSDL">
<schema location="../JavaProcess.wsdl"/>
<rootElement name="process" namespace="http://xmlns.oracle.com/SampleApplication/JavaEmbeddingActivity/JavaProcess"/>
</source>
</mapSources>
<mapTargets>
<target type="WSDL">
<schema location="../JavaProcess.wsdl"/>
<rootElement name="processResponse" namespace="http://xmlns.oracle.com/SampleApplication/JavaEmbeddingActivity/JavaProcess"/>
</target>
</mapTargets>
<!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.4.0(build 110106.1932.5682) AT [TUE MAY 07 10:21:02 EDT 2013]. -->
?>
<xsl:stylesheet version="1.0"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:med="http://schemas.oracle.com/mediator/xpath"
xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpmn="http://schemas.oracle.com/bpm/xpath"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:client="client"
exclude-result-prefixes="xsi xsl bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref bpmn ora socket ldap">
<xsl:template match="/">
<xsl:variable name="lastMTime" select="1366664691000"/>
<xsl:copy-of select="$lastMTime"/>
<client:processResponse>
<client:result>
<xsl:value-of select='xsd:dateTime("1970-01-01T00:00:00") + $lastMTime * xsd:dayTimeDuration("PT0.001S")'/>
</client:result>
</client:processResponse>
</xsl:template>
</xsl:stylesheet> -
How to convert milliseconds to date format in sql query
Hi All,
The following code is in java.
String yourmilliseconds = "1316673707162";**
Date resultdate = new Date(Long.parseLong(yourmilliseconds));
could you plese tell me how to convert milliseconds into date format in query and comparing with another date like(sysdate-3)Hello,
http://stackoverflow.com/questions/3820179/convert-epoch-to-date-in-sqlplus-oracle
Regards -
I want to be able to convert PDFs into another format and I know this can be achieved with a small upgrade. However I am also looking for the ability to compress the size of PDFs, if this is at all possible.
You can use Acrobat Standard for this.
-
Problem with Euro sign when converting it into PDF Format
Hi all,
i am facing problem with Euro (u20AC) sign,
it is displayina s #
when converting one smartform into PDF format.
Can any body sugest me in doing this??
it is appriciable if any body can help m??
thanks in advance
Regards,
Srikanth.Hi Srikanth,
I think I'm facing the same issue as you. I looked at the note 323736 but my system seems to be up to date (at least for this issue). I have SAP_BASIS release 700.
Did you upgrade your system ? Did you do something else ?
Thanks for your help.
Best regards,
Pierre -
Converting files into pdf format in java
Hi all,
How can we convert a file into PDF format in java?My application does the
file upload, and I need the files to be converted into PDF format.
The uploaded file can be of any type. How can I do this?
Please give me some help.
Thanks and regards,
Sandeep.>
How can we convert a file into PDF format in java?My application does the
file upload, and I need the files to be converted into PDF format.
The uploaded file can be of any type. ...>1) Write a class that will intelligently render a file of any type..
2) ... (well, do '1' first, then after getting your Nobel prize for AI, come back and we'll talk)
>
Please give me some help.>Please review your requirement.
BTW
- PDF sucks. It is designed for printing, and I (for one) don't want to kill more trees, and have no printer.
- This subject (convert file to PDF) has been discussed on the forums a bazillion times. Did you search the forums before asking your two (very closely related) questions? -
Convert PO into PDF format and send by an email to vendor
We are using SAP version ECC 5.0. We want to convert SAP PO into PDF format and attached it in an email and send it to vendor. Please give me some tips to achieve this?
Thanks in advance!
MrudulaHi!
The way to achieve your goal depends on how you get PO printed - by sapscript, smartform or abap list.
As have been mentioned you can create spool request and process it. But for sapscript and smartform you can proceed without spool request - just get back OTF data from corresponding FM and convert it to PDF.
In case of smartform:
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZFORMNAME'
IMPORTING
fm_name = v_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
i_otf[] = w_return-otfdata[].
In case of sapscript:
options-tdgetotf = 'X'.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
options = options
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
otfdata = i_otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
OTHERS = 5.
Then convert to PDF
DATA:
pdf LIKE tline OCCURS 100 WITH HEADER LINE,
v_len_in LIKE sood-objlen.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
ARCHIVE_INDEX = ' '
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = pdf
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4
Then send as attachment as Max proposed.
Regards,
Maxim. -
Convert data into Date Format imported from MS SQL Server.
I have imported Data from MS SQL Server. The "Date Column" received in number format like 41017.6361109954. How can i convert it into Date in Oracle SQL.
If i import same Data in Excel and change the Column Type to Date. It changes successfully. But in Oracle, I tried To_Date function with different parameters but it didn't work.
Edited by: XAVER on Apr 22, 2012 2:31 AMXAVER wrote:
The actual date for 41017.6361109954 is 22-Apr-2012 but its showing 20-APR-2082It looks like offset is January 1, 2000:
select timestamp '2000-01-01 00:00:00' + numtodsinterval(41017.6361109954,'day') from dual;
20-APR-12 03.15.59.990002560 PM
SQL> SY. -
Converting bytearray into binary format
Hi I have a byteaary , I want to convert this byteArray data into binary format (01010101) , Please help me
[Bindable]
private var imgByte:ByteArray;
bitmapData = new BitmapData(pic.width, pic.height);
bitmapData.draw(pic,new Matrix());
var jpg:JPEGEncoder = new JPEGEncoder();
imgByte = jpg.encode(bitmapData) ;
var i:int=imgByte.readByte()
Alert.show(i.toString(2));
thanks in advanceDidn't toString(2) work?
-
Convert pdf into excel format - format issue
Before I purchase an Adobe Acrobat Pro XI I have downloaded the trail version for evaluating. I have also run an Update of the program.
Our company is receiving a lot of order files in PDF-format and instead of entering the order lines manually into our order system we want to convert these pdf files into Excel format. We can then use this xls file to upload the order into SAP and in that way save a lot of time. The pdf file consists of several columns as material number, description, quantity …..I want that every column in the pdf document also appears in one own column in the xls file. This works for several order lines but then suddenly are all the columns for some order line written into one and the same column and then are the columns again correctly written. I have tried with several pdf files with the same problem. Has anyone any idea what the reason for this issue is?Is this a PDF form? If so, you should be able to extract the data in the form using the manage data under the forms tools. That may be what you are looking for.
Whenever I see a post related to forms by a commercial concern, there is an issue related to Reader rights. Some of this has changed with AA XI and it would be good to review the license agreement carefully to be sure you are in compliance (law suits are not pretty). -
Converting milliseconds into formatted HHh MM' SS''
Is there an example of a NumberFormat class that converts a certain amount of milliseconds, say 2374894 into hours, minutes, and seconds like this: HHh MM' SS''?
That is the approach I was taking before, but the specification requires that I use a NumberFormat class. No strings allowed...
I have the logic created (this is not in Java):
public function formatDuration():String
var convResult:Number = 0;
var hours:Number = 0;
var minutes:Number = 0;
var seconds:Number = 0;
var minutesString:String;
var secondsString:String;
hours = parseFloat(integerFormat.format(durationMs / 3600000));
convResult = (summaryData.durationMs / 3600000) - hours;
minutes = parseFloat(integerFormat.format(convResult * 60));
convResult = (convResult * 60) - minutes;
seconds = parseFloat(integerFormat1.format(convResult * 60));
minutesString = minutes.toString();
if(seconds<10)
secondsString = "0" + seconds.toString();
else
secondsString = seconds.toString();
if(durationMs >= 3600000)
return hours + "h" + minutesString + "'";
else
return minutesString + "'" + secondsString + "''";
} -
Converting Javabeans into XML format
HI,
I have wrote program that will read input from users then stored them in javabeans. I used the serialize function to create xml file from the javabeans.
public static void CreateXML(LocationRequest location)
try
// Serialize object into XML
XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
new FileOutputStream("test.xml")));
encoder.writeObject(location);
encoder.close();
} catch (FileNotFoundException e) {
The output file is as follows :
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.4.1_05" class="java.beans.XMLDecoder">
<object >
<void property="address">
<string>21212122</string>
</void>
<void property="originatorId">
<string>Anu</string>
</void>
</object>
</java>
Could anyone has idea on how i can change the above xml file into another new xml format like below:-
<address> 21212122</address>
<originatorId> "Anu "</originatorId>
Cheers,
BambliThe quickest way would be to use XSLT. Write a stylesheet that converts your 1st format to your 2nd format.
Here's an example stylesheet. (I'm a little rusty on my XSL so you'll want to test this.)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<!-- simply copy the message to the result tree -->
<xsl:template match="/java/object/void/@property">
<xsl:element name="local-name()">
<xsl:value-of select="text()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet> Feed this to a transformer as follows:
javax.xml.transform.TranformFacotry factory = javax.xml.transform.TransformerFactory.newInstance();
javax.xml.transform.stream.StreamSource source = new javax.xml.transform.stream.StreamSource(new java.io.File("yourstylesheet.xsl"));
javax.xml.transform.Transformer xformer =factory.newTransformer(source);
xformer.transform(new javax.xml.transform.stream.StreamSource(new java.io.File("yourbean.xml")),new javax.xml.transform.stream.StreamResult(new java.io.File("yourconverted.xml")));Its that simple.
Cliff -
Converting 0FISCPER into 0FISCYEAR format
Hi all,
I have a requirement to convert value of type 0FISCPER into a 0FISCYEAR format. This needs to be done as a FOX formula in my parameter group. Can anyone give suggestion please? I'm new to BPS.
Thanks,
AloyHi,
Thank you very much for your reply. I have tried your suggestion but some sort of data type mismatch error came out. The result of SUBSTR is of type string but the 0FISCYEAR however is non-string. As I'll just be using the fiscal year value on my IF condition, I managed to make do by defining a fiscal year variable of type string and use this to assign the result of substr. Now it works.
Thanks again.
Aloy -
Data conversion into specified format using Script component in SSIS 2008
We have a field in the flat file source which is of the format 13399I , and it need to be type cast to the below format.
13399I = 1339.99
5950{ = 595.00
The sign field equals:
{=0
A=1
B=2
C=3
D=4
E=5
F=6
G=7
H=8
I=9
please let us know how to accomplish using script component in SSISYou can use the following in the script task.
1) Create a dictionary to hold the key-value pairs ({=0,A=1...).
2) Use a substring function to pull out all the string minus the last character.
3) Append the last character back after replacing the character with the respective value from the dictionary.
4) Convert the final string to int/decimal/numeric as per the destination.
Do keep in mind, the data you are referring to is in the COMP3 format. You can do some further research regarding how to convert COMP3 to decimal. There are many ways out there. I personally prefer to load the data into a table and us a lookup table
to do all this. But it's entirely by preference. -
Garageband volume problem after converting project into mp3 formats
Every time after I convert my music project into MP3 by clicking "send song to i-tune" in GarageBand, the volume of the music always come out to be softer than the original project before its been converted. Is there something I could do to fix that or to boost up the volume after I convert it?
Boattt wrote:
Is there something I could do to fix that or to boost up the volume after I convert it?
http://www.bulletsandbones.com/GB/GBFAQ.html#exportvolumetoolow
(Let the page FULLY load. The link to your answer is at the top of your screen)
Maybe you are looking for
-
i've lost all my contacts recently on Adress Book fortunately there are from my Yahoo account, except that now i no longer can Import them. AB won't even give me the option to import, the option disabled. stef./.\
-
I am suddenly seing weird "symbol" or "dingbat" characters on web pages instead of letters, and this is happening on all browsers I try (firefox, safari, explorer). How do I fix this?
-
NullReferenceException was unhandled
I am Building a Webbrowser in C#: this is the code using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.
-
FCS 2 -- Mac Pro 4-core or 8-core?
Been reading both the FCP forum and the MacPro forum and still not unsure which way to go. I'm an avid Avid user (sorry about that) for many years and now making the switch to FCS2. My confusion lies in which configuration to get to best maximize FCS
-
How to install Aperture without original dvd
I lost my Aperture 2 installation and Aperture 3 upgrade disks. How to install Aperture in my new Macbook ?