How to Convert Calender to Date
Hi.
I have Calender object (MM dd,yyyy), I wanted to convert this into Date object in the format of "yyyy-mm-dd". Can any one please give me code to do this ?
Thanks
Sarav.
Use Calendar.getTime() to get a Date object corresponding to the point in time that the Calendar represents.
But note that Dates don't have formats. If you want the time formatted in a particular way, use a java.text.SimpleDateFormat.
Similar Messages
-
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 -
How to convert files into DAT?
Does anyone know how to convert files into DAT? Not The other way around please.
This might do it:
http://www.videoconverterformac.com/dat-converter-for-mac.html
but can't imagine why you would want to! -
How to convert internal table data to PDF format
HI,
I have an internal table data having one field with 255 chars. length.I want to send that intenal table data as attachemnt with external mail. i am thinking of converting that data into PDF format and use the FM to send the mail. How to convert internal table data to PDF format.
KishoreIn which format is your data in the internal table currently. Is it returned by a smartform/script or its just data fetched from some database table into an internal table. Since its obvious that the data should appear in the PDF with some Layout, you should be using smartform to format the data properly. See the Link
Smartform to PDF to EMAIL
This shows convertion of smartform to pdf and send it through email
Regards,
Abhishek -
How to Convert internal table data into text output and send mail in ABAP
Hi All,
Good Morning.
Taking a glance at a code that converts internal table data to an Excel file in ABAP. also checked how to send this excel to mailing list as attachment.
But thought of doing it without excel.
I mean, I have an internal table which contains fields of all types (character,integer,date,time). Since it is only around 4 to 5 rows in it (output),why to convert it to excel. not required!!. Instead I want to send this output to User's mails as Normal mail body with No attachments.
Could anybody please suggest me a way as to how to send internal table data as a mail ( not as an excel or PDF etc).
as of now my findings are, it is quite complex to convert internal table data to email (Text) format. but i believe if there is some way of doing it.
Best Regards
Dileep VThere's something I have used in the past where we send out information about failed precalculation settings (which are stored in internal table gt_fail)
notice we use gt_text as "mail body"
TRY.
* -------- create persistent send request ------------------------
gv_send_request = cl_bcs=>create_persistent( ).
* -------- create and set document -------------------------------
* create text to be sent
wa_line = text-001.
APPEND wa_line TO gt_text.
CLEAR wa_line.
APPEND wa_line TO gt_text.
LOOP AT gt_fail ASSIGNING <fs_fail>.
MOVE <fs_fail>-retry_count TO gv_count.
CONCATENATE text-002
<fs_fail>-setting_id
text-003
gv_count
INTO wa_line SEPARATED BY space.
APPEND wa_line TO gt_text.
CLEAR wa_line.
ENDLOOP.
APPEND wa_line TO gt_text.
wa_line = text-007.
APPEND wa_line TO gt_text.
* create actual document
gv_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = gt_text
i_length = '12'
i_subject = 'Failed Precalculation Settings!' ).
* add document to send request
CALL METHOD gv_send_request->set_document( gv_document ).
* --------- set sender -------------------------------------------
gv_sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD gv_send_request->set_sender
EXPORTING
i_sender = gv_sender.
* --------- add recipient (e-mail address) -----------------------
LOOP AT s_email INTO wa_email.
MOVE wa_email-low TO gv_email.
gv_recipient = cl_cam_address_bcs=>create_internet_address(
gv_email ).
CALL METHOD gv_send_request->add_recipient
EXPORTING
i_recipient = gv_recipient
i_express = 'X'.
ENDLOOP.
* ---------- set to send immediately -----------------------------
CALL METHOD gv_send_request->set_send_immediately( 'X' ).
* ---------- send document ---------------------------------------
CALL METHOD gv_send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = gv_sent_to_all ).
IF gv_sent_to_all = 'X'.
WRITE text-004.
ENDIF.
COMMIT WORK.
* exception handling
CATCH cx_bcs INTO gv_bcs_exception.
WRITE: text-005.
WRITE: text-006, gv_bcs_exception->error_type.
EXIT.
ENDTRY.
with the following declarations
* TABLES *
TABLES:
adr6,
rsr_prec_sett.
* INTERNAL TABLES & WORK AREAS *
DATA:
gt_fail TYPE SORTED TABLE OF rsr_prec_sett
WITH UNIQUE KEY setting_id run_date,
gt_text TYPE bcsy_text,
wa_fail LIKE LINE OF gt_fail,
wa_line(90) TYPE c.
FIELD-SYMBOLS:
<fs_fail> LIKE LINE OF gt_fail.
* VARIABLES *
DATA:
gv_count(4) TYPE n,
gv_send_request TYPE REF TO cl_bcs,
gv_document TYPE REF TO cl_document_bcs,
gv_sender TYPE REF TO cl_sapuser_bcs,
gv_recipient TYPE REF TO if_recipient_bcs,
gv_email TYPE adr6-smtp_addr,
gv_bcs_exception TYPE REF TO cx_bcs,
gv_sent_to_all TYPE os_boolean.
* SELECTION-SCREEN *
SELECT-OPTIONS:
s_email FOR adr6-smtp_addr NO INTERVALS MODIF ID sel.
DATA:
wa_email LIKE LINE OF s_email. -
Convert Calender to date with MM-DD-YYYY
I want to convert calendar object to date with the format of DD-MM-YYYY
How to do this?Calculating Java dates: Take the time to learn how to create and use dates
Working in Java time: Learn the basics of calculating elapsed time in Java
Formatting a Date Using a Custom Format
Parsing a Date Using a Custom Format -
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 internal table data into xml and xml data into internal tab
Hi Guys,
I have a requirement that i have to convert the internal table data into xml format and viceversa . for my requirement i came to know that i have to use Transformations concept. i done the converting the data from internal table into xml data by using standard Tranformations. My Question is
1) Can i use same Transformation to convert the xml data into abap internal table. if it is possible then how ???
2) Is it possible using the standard Transformation or I have to go for XSLT approach
Please help me out from this guys,
Thanks and Regards
KotiHi Koti,
This is possible. There is a link. With the help of this link you can convert ABAP data to XML and vice versa.
Link: http://www.heidoc.net/joomla/index.php?option=com_content&view=article&id=15:sapxslt&catid=22:sap-xslt&Itemid=31 -
How to convert digital array data into analog signal
i want help to convert digital data array into analog signal
shubham62 wrote:
We are implimenting real time audio trans-receiver. We have converted input audio data(analog form) into digital data. At the receiver side we received digital data which is in the form of digital data array.But we are unable to recover back our original input data. So please help us to sort out the problem.
Still no useful information. How was the data converted to digital in the first place? What conversion parameters did you use? As was said, you just need to do the math backwards to get it back into the analog.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
How to Convert DateTime to Date ?
This sounds easy, but I'm not progressing as I should.
element MyDate : Date;
MyDate = contract.ValidityPeriod.TimePointPeriod.StartTimePoint.DateTime. ;
The above complains about "Assignment of type DateTime to type Date is not possible".
I've looked into DateTime functions, but am not getting anywhere.
Any tips on how to convert a DateTime field to Date field ?Afaik, AP.Common.GDT.DateTime does not have a ConvertToGlobalDateTime method, furthermore retrieving the date from the globalDateTime could give you the wrong local date since it does do not consider time zones.
I would use the similar to the following (no guarantee about correctness):
import ABSL;
import AP.Common.GDT;
var In = contract.ValidityPeriod.TimePointPeriod.StartTimePoint.DateTime;
// convert To GlobalDateTime
var timeGlobal = GlobalDateTime.ParseFromString(In.content.ToString()); // not sure whether this is correct -> please verify yourself
// convert to LOCAL_DateTime using timeZone
var timeZone = In.timeZoneCode;
var localDateTime = timeGlobal.ConvertToLocalDateTime(timeZone);
var localDateTimeStr = localDateTime.ToString();
// cut off time suffix (starts with "T")
var localDateStr = localDateTimeStr.Substring(0, localDateTimeStr.Find("T"));
var date = ABSL:Date.ParseFromString(localDateStr);
Best regards,
Ludger -
How to convert balance to data?
I've topped up the credit balance for my USB mobile WIFI dongle, and now I'm told I need to convert it to data.It's not clear how to do this on the webpage that shows the balance. What's the secret, please?
The device isn't a phone. Can I text from a dongle?
-
How to convert a dynamic data type to array of strings
I want to perform a serial communication between two
computers that I´ll call them A and B. The computer A (transmitter)
will send a signal (sinusoidal) to computer B (receiver). I´m using a
VISA Serial Communications Set (VISA Configure Serial Port.vi, VISA
Write.vi, VISA Read.vi and VISA Close.vi). VISA Write accepts
only string data type and VISA Read reads only string data type, but
the signal that I generated (on transmitter) is dynamic data and I need
to perform this conversion to run my program sucessfully. How can I
perform this conversion?!Hi Rafael,
You can configure the From DDT Express VI to convert your dynamic data to any number of different types. By default, the Express VI will convert to a 1D array of numerics...however, you can configure it (either when you first drop it, or by double-clicking it) to convert to a 2D array of numerics...additionally, you can configure it to convert based on channel data being in columns or rows. I have attached another screenshot that shows converting the dynamic data into a 2D numeric array.
I hope this helps.
-D
Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman
Attachments:
FromDDT2D.jpg 164 KB -
How to convert internal table data into excel format?
Hi all,
I want to convert internal table data in excel format and then
send it as email attachment in workflow.
Please tell me how do i perform this.
Regards,
Arpita.Hi Arpita,
Try this sample code::
Send mail
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test Subject'.
loop at htmllines.
mailtxt = htmllines.
append mailtxt.
endloop.
mailrec-receiver = 'your receiver mail id'.
mailrec-rec_type = 'U'.
append mailrec.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'EXL'
put_in_outbox = 'X'
tables
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
if sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Hope it will help you.
Regards,
NIkita -
How to convert varchar to date datatype while insert or update in table
Hai All
I need to convert to varchar to date.
I have two Tables T1,T2
T1 Structure
Code varchar
Time varchar
Date varchar
T2 Structure
Empname var
Empcode var
Intime date
Outtime date
Intrin date
Introut date
Att_date
Now i need to move Time form T1 to T2 Intime,outtime,intrin,introut according some condition
So now i need to convert Varchar to Date while insert or update
I have tried something
Insert into T1 (code,intime,att_date)values
(code,To_date(Date||time,'dd-mon-yyyy hh24mi'),att_date);
OR While update
Update T2 set Outtime=To_date(Date||time,'dd-mon-yyyy hh24mi') where...
I got an error Ora-01861
Regards
Srikkanth.MYou didn't show any example of your date or time values, butyou might need to add a space between them, like
To_date(Date || ' ' || time,'dd-mon-yyyy hh24mi') -
How to convert server specific date string into client specific date object
Hi developers,
I have a very complex issue to convert the server date string format "EEE MMM dd HH:mm:ss z yyyy" into java.util.Date object and find the difference of the client machine date to represent the elapsed time
The problem is the server time zone and client time zone are not unique and when I try to covert the server date which is in string format to date format using SimpleDateFormat class , I got the server time as 3:30 hours appended to it. The server time zone is in IST and Client time zone format is GMT+5:30 , the appended time of 3:30 hours created the confusion in calculating the elapsed time between the server started time and client requested time
I went through all the sites but none of them were useful
If any help to solve the above issue is appriciated
please send the response with the same subject line
Advance ThanksWhy don't you just subtract from the server time the 3:30 hours (consult api of java.util.date) before comparing with the client date? Hard to see where's the problem...
Maybe you are looking for
-
IPhone - serious email issue - there has to be a fix?
Iphone Model MC608LL Version 4.3.1 Firmware 4.10.10 Cellular ATT Mail Charter I have a new iPhone. It will not drop the mail connection to the email server. Please read the following thread before responding if you would please. I have been working o
-
I am using CREMS04 to try and create a vendor master record. However I am getting an erro saying invlaid function code. I am using the message code 009 to try and create the IDOC. Can anyone shed some light on how to create a simple vendor master
-
How do I install textures in Photoshop CS6 for a Mac?
I have downloaded some textures and wish to install them. I have gone into Finder, found the presets folder but I don't have a texture folder? Can anyone help? Thanks Jason
-
Recipient address rejected: User unknown in relay recipient table
Running GW 7.0.3 on NW 6.5.6. Can anyone tell me if this is my problem or if it is the recipients system. Other email to the same domain goes through. Thanks, Bill
-
Corrupted dimension after level adding
Hi, I observed twice this buggy behaviour in OWB 11gR2. A dimension is here working perfectly with its underlying table. Then comes a new requirement and a further level is to add. I did all necessary steps (adding level, adding hierarchy, modifying