Converting Date Into Milliseconds?
I want to convert the following date and time into milliseconds: 4/21/2003 21.50. I know how to convert milliseconds into a date, but not the other way around. Could someone, please, help?
String etd = "4/21/2003 10:45";
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
df.setLenient(true);
try {
df.parse(etd);
catch(Exception e) {
e.printStackTrace();
I'm trying to use DateFormat to convert a date into ms. However, I'm getting a parsing error. Any suggestions?
Similar Messages
-
Methods in bapi used to convert data into XML
Methods in bapi used to convert data into XML,
how to implement those also,
points will be rewarded
Thank you,
Regards,
Jagrut BharatKumar ShuklaHi
Check this
http://www.sap-img.com/abap/sample-xml-source-code-for-sap.htm
https://forums.sdn.sap.com/click.jspa?searchID=2889167&messageID=3406594
Reward points for useful Answers
Regards
Anji -
HOW TO CONVERT DATE INTO NUMBERS
HI,
what the syntax for converting date into No. Ex from the first date of the month till current date how many days are there, this No of days needs to be divided by the net sale of the month.
i have searched in formulas fields but i am not able to find such option...
please help.
Thanking you,
UMAR NAYAB.Hi,
Stratos and Sastry
the formula given by you shows the variation for the current month of suppose 30 days
but if the month is of 31 days or 28 days (feb) how will the system will able to generate the report accordingly.
i want to make a report in which it should show the net sales by the current month and current date.
so the system should automated by the number of days in a month.
thanking you..
UMAR NAYAB. -
How to convert date to milliseconds?
hi,
can anybody tell me how to convert date to milliseconds.
thanks,
ayathasSee milliseconds and time properties:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html -
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. -
Tool required to convert data into script
I have one staff table with following data
empno, name, dob
12345, kala, 25-aug-1960
23456, anugraha,05-mar-1991
34567,abiya,01-jul-1984
I want to send this data to another domain where the staff table exists with the same structure.
hence i need script file as follows
insert into staff values (12345, 'kala', '25-aug-1960');
insert into staff values (23456, 'anugraha','05-mar-1991');
insert into staff values (34567,'abiya','01-jul-1984');
i can run this script to load data into that new staff table under different domain.
Every day's transaction, i want to create this script file and store it in different domain.
Is there any facility to convert my entire data as above script file instead of writing procedures using cursors.In Oracle SQL Developer, you can right-click on a table and export the data as INSERT statements, among other formats.
Thanks,
- Scott -
http://sumnertechnologies.com/
http://spendolini.blogspot.com/ -
How to convert date into dd mon yyyy format
hi all,
i have a problem in date format i am using date like below .
<%java.util.Date date = new java.util.Date();%>
i am inserting date into a table and its storing like this
insert into tablename (d_date) values (date)
and its inserting date like below
Sun Oct 19 09:05:45 GMT+03:00 2003
i want to fetch date in dd mon yyyy format.
with this format i want to make a select query.i struck with the format conversion.
how to do this.
any comments please.
any helphi all,
i understand now where i am wrong.
the below code is not working why because in my server where i am executing code the regional setting month value is in arabic.
i executed the same code in a different server where date and time jones are english its working fine.
All the problem is in regional setting and not the jsp code.
<%
String whtEverDateFormatYouWAnt = "dd MMM yy";
String str = new SimpleDateFormat(whtEverDateFormatYouWAnt).format(new SimpleDateFormat("EEE MMM dd HH:mm:ss vvv yyyy").parse("Sun Oct 19 09:05:45 GMT+03:00 2003"));
out.print(str);
%>
Thanks a lot for the excellent solution.
Thanks again. -
Function to convert timestamps into milliseconds
Hi,
Does SAP have a function module which can read in a date/timestamp and output that time in milliseconds (a long integer starting from 1st January 1970)?
Many thanks in advance,
Petertry:
PARAMETERS:d2 TYPE sy-datum DEFAULT sy-datum,
d1 TYPE sy-datum default '19700101'.
data sec_day TYPE i . "ms per day
DATA : d TYPE i.
DATA result TYPE f.
DATA rp(16) type p decimals 0.
AT SELECTION-SCREEN ON d2.
IF d2 LE d1.
MESSAGE e001(00) WITH 'date must be greater than 1970/01/01'.
ENDIF.
START-OF-SELECTION.
sec_day = 24 * 60 * 60 * 1000.
d = d2 - d1.
rp = result = d * sec_day.
WRITE: / d2, d1, d, / result, rp.
hope that helps
Andreas
Edited by: Andreas Mann on Apr 10, 2008 3:37 PM -
Why dose Numbers 3.0 while opening csv-Files converts Dates into Integers?
I want to open a csv-file with a date.
The Date is in german notation.
28.10.2013 the value in the cell is 40113.
This problem occures only in Numbers 3.0
if I open the same file with Numbers 2.3 it is ok.
How can I change it.
The Systempreferences of the date and time handling is ok.2. Even though I have set the data type to text within EPMA, once I deploy the application and check it with the EAS console, the data type is NUMERIC - NOT TEXT anymore. This blows my mind. I don't know why this happens.
Its common ...As enter a text wavlue which has been entered in planning as text in number...Their are certain table's in planning which play role while fetching such values....
Cheers!
Sh!va -
Converting date into day of year
I'm trying to write a program that prints the day of the year, given the date is in "month day year" form ie: 1 1 05, is day number 1 and 12 25 05 is day number 359.
the program should also check for a leap year.
I found this in a Google search and it's rediculously close to what i'm looking to achive, but instead of "today's date" i need it to read a day that was entered using Scanner or JOptionPane... and it would have to be in the above format when being entered.
import java.util.Calendar;
public class CalendarExample
public static void main(String[] args)
Calendar cal = Calendar.getInstance();
int day = cal.get(Calendar.DATE);
int month = cal.get(Calendar.MONTH) + 1;
int year = cal.get(Calendar.YEAR);
int dow = cal.get(Calendar.DAY_OF_WEEK);
int dom = cal.get(Calendar.DAY_OF_MONTH);
int doy = cal.get(Calendar.DAY_OF_YEAR);
System.out.println("Current Date: " + cal.getTime());
System.out.println("Day: " + day);
System.out.println("Month: " + month);
System.out.println("Year: " + year);
System.out.println("Day of Week: " + dow);
System.out.println("Day of Month: " + dom);
System.out.println("Day of Year: " + doy);
this if for a begining level java class, and I have no idea where to get started. Any help would be appreciated.End result
import java.util.Scanner;
public class dayoftheYear
public static void main(String[] args)
//Declare variables
int day, month, year, doy=0, Jan=31, Feb=28, Febleap=29, Mar=31;
int Apr=30, May=31, Jun=30, Jul=31, Aug=31, Sep=30, Oct=31, Nov=30, Dec=31;
//Description
System.out.println("************************************************************");
System.out.println("This application will"
+ " use input for month and day "
+ "\nto determine what day of the year "
+ "it is. It will also check "
+ "\nto see if it's a leap year and adjust "
+ "\nthe day of the year accordingly");
System.out.println("************************************************************");
System.out.println();
//Create a Scanner object to read input.
Scanner keyboard = new Scanner(System.in);
//Input and print number.
System.out.print("Input month: ");
//Assign input
month = keyboard.nextInt();
//Input and print number.
System.out.print("Input day: ");
//Assign input
day = keyboard.nextInt();
//Input and print number.
System.out.print("Input year: ");
//Assign input
year = keyboard.nextInt();
//If leapyear, Feb has 29 days
if(isLeap(year)==1)
Feb =29;
//Determine day of year
switch (month)
case 1: doy=day; break;
case 2: doy=Jan+day; break;
case 3: doy=Jan+Feb+day; break;
case 4: doy=Jan+Feb+Mar+day; break;
case 5: doy=Jan+Feb+Mar+Apr+day; break;
case 6: doy=Jan+Feb+Mar+Apr+May+day; break;
case 7: doy=Jan+Feb+Mar+Apr+May+Jun+day; break;
case 8: doy=Jan+Feb+Mar+Apr+May+Jun+Jul+day; break;
case 9: doy=Jan+Feb+Mar+Apr+May+Jun+Jul+Aug+day; break;
case 10: doy=Jan+Feb+Mar+Apr+May+Jun+Jul+Aug+Sep+day; break;
case 11: doy=Jan+Feb+Mar+Apr+May+Jun+Jul+Aug+Sep+Oct+day; break;
case 12: doy=Jan+Feb+Mar+Apr+May+Jun+Jul+Aug+Sep+Oct+Nov+day; break; //hey! that looks pretty!
default: System.out.println("Invalid month.");break;
//Print day of year
System.out.println("Day of year: " +doy);
}//endmain
//beginmethod
public static int isLeap(int y)
//Assuming Y2K compliancy is not an issue, all dates will be based in the year 2000+
y += 2000;
//Check if year is a leap year
if(y%4==0&&y%100!=0)
return 1; //yes
else if(y%100==0&&y%400==0)
return 1; //yes
else
return 0; //no
}//endmethod
} -
How to convert date dd.mm.yyyy TO Month ddth YYYY?
hi friends,
how to convert date into this format.
ex:
date : 04.11.2008
has to convert as
October 04th, 2008
th has to be set SUPERSCRIPT.
Plz any helps....
Regards,
Shankar.check this..FM
CONVERT_DATE_TO_EXTERNAL
or we can do this using split or concatenate functions like below
*CALCULATING THE MONTH FOR THE BODY OF THE EMAIL MSG
IF GD_EBODY_BB = '01' .
GD_EBODY_BB = 'January' .
ELSEIF GD_EBODY_BB = '02' .
GD_EBODY_BB = 'February' .
ELSEIF GD_EBODY_BB = '03' .
GD_EBODY_BB = 'March' .
ELSEIF GD_EBODY_BB = '04' .
GD_EBODY_BB = 'April' .
ELSEIF GD_EBODY_BB = '05' .
GD_EBODY_BB = 'May' .
ELSEIF GD_EBODY_BB = '06' .
GD_EBODY_BB = 'June' .
ELSEIF GD_EBODY_BB = '07' .
GD_EBODY_BB = 'July' .
ELSEIF GD_EBODY_BB = '08' .
GD_EBODY_BB = 'August' .
ELSEIF GD_EBODY_BB = '09' .
GD_EBODY_BB = 'September' .
ELSEIF GD_EBODY_BB = '10' .
GD_EBODY_BB = 'October' .
ELSEIF GD_EBODY_BB = '11' .
GD_EBODY_BB = 'November' .
ELSEIF GD_EBODY_BB = '12' .
GD_EBODY_BB = 'December' .
ENDIF .
*ATTACHMENT SUBJECT LINE MODIFICATION
IF GD_EBODY_CC = '01'.
CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
ELSEIF GD_EBODY_CC = '02' .
CONCATENATE GD_EBODY_CC 'nd' INTO GD_EBODY_CC .
ELSEIF GD_EBODY_CC = '03' .
CONCATENATE GD_EBODY_CC 'rd' INTO GD_EBODY_CC .
ELSEIF GD_EBODY_CC = '31'.
CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
ELSEIF GD_EBODY_CC = '21'.
CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
ELSE .
CONCATENATE GD_EBODY_CC 'th' INTO GD_EBODY_CC .
ENDIF .
regards
ansumesh
Edited by: Ansumesh Kumar Samal on Nov 4, 2008 9:02 AM -
Convert date format from MONTH-YEAR to dd/mm/yyyy
Dear All
i want to get parameter in form of MONTH-YEAR AND WANT TO CONVERT DATE INTO 'THIS FORMAT dd/mm/yyyy' IT GIVES ME ERROR PLEASE GUIDE.
SELECT
TO_CHAR (PTP.END_DATE,'MONTH-YY') ,
to_date ( TO_CHAR (PTP.END_DATE ,'DD-MONTH-YYYY') ,'dd/mm/yyyy'),
--- i want to gent parameter in from of MONTH-YEAR AND WANT TO CONVERT DATE INTO 'THIS FORMAT dd/mm/yyyy' IT GIVES ME ERROR PLEASE GUIDE
to_date ( TO_CHAR (PTP.END_DATE ,'MONTH-YYYY') ,'dd/mm/yyyy'),
ADD_MONTHS((to_date ( TO_CHAR (PTP.END_DATE ,'MONTH-YYYY') ,'dd/mm/yyyy'),-1)
--- i want to gent parameter in from of MONTH-YEAR AND WANT TO CONVERT DATE INTO 'THIS FORMAT dd/mm/yyyy' IT GIVES ME ERROR PLEASE GUIDE
ptp.END_DATE PERRIODS_NAME
from per_time_periods ptp
Regards
Edited by: user10941925 on Nov 28, 2011 12:23 AMHello just check
SQL> select hiredate from emp;
HIREDATE
17-DEC-80
20-FEB-81
22-FEB-81
02-APR-81
28-SEP-81
01-MAY-81
09-JUN-81
09-DEC-82
17-NOV-81
08-SEP-81
12-JAN-83
03-DEC-81
03-DEC-81
23-JAN-82
14 rows selected.
SQL> select to_char(hiredate,'month-year') from emp;
TO_CHAR(HIREDATE,'MONTH-YEAR')
december -nineteen eighty
february -nineteen eighty-one
february -nineteen eighty-one
april -nineteen eighty-one
september-nineteen eighty-one
may -nineteen eighty-one
june -nineteen eighty-one
december -nineteen eighty-two
november -nineteen eighty-one
september-nineteen eighty-one
january -nineteen eighty-three
december -nineteen eighty-one
december -nineteen eighty-one
january -nineteen eighty-two
14 rows selected.
SQL> select to_char(hiredate,'dd/mm/yyyy') from emp;
TO_CHAR(HI
17/12/1980
20/02/1981
22/02/1981
02/04/1981
28/09/1981
01/05/1981
09/06/1981
09/12/1982
17/11/1981
08/09/1981
12/01/1983
03/12/1981
03/12/1981
23/01/1982
14 rows selected.
SQL> -
Converting Date of Bith to Age
Is it possible to use a formula to convert a whole column of DOB's into ages.
ThanksTSCM88 wrote:
Thank you very much Barry, your post was very helpful. I took your advice and downloaded the user guides. My aim is to convert dates into years and months. I have tried to create a formula for this but it will not work, would very much appreciate any tips. I am unable to combine the DATEIF function with a month calculating function, i have been trying EDATE.
Depends what you mean by "a month calculating function" and "combine".
Did you check the DATEDIF entry in the F&F User Guide and try some of the calculation methods listed?
You can calculate the difference between two dates in years, months, weeks or days, or combinations of these.
This formula, for instance will give the age today in years and months for a birthdate placed in column B:
=DATEDIF(B,TODAY(),"Y")&"y, "&DATEDIF(B,TODAY(),"YM")&"m"
Regards,
Barry -
Hi All,
I calculated opening stock,closing stock based on the date,now I need to calculate based on month also,
Is any functionmodule is there to convert date into month.
Thanks@regds,
Sree.hi
list of FM try
A
CALCULATE_DATE : Calculates the future date based on the input .
v DATE_TO_DAY : Returns the Day for the entered date.
v DATE_COMPUTE_DAY : Returns weekday for a date
v DATE_GET_WEEK : Returns week for a date
v RP_CALC_DATE_IN_INTERVAL : Add days / months to a date
v DAY_ATTRIBUTES_GET : Returns attributes for a range of dates specified
v MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
v END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
v HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
v FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
v MONTH_NAMES_GET : Get the names of the month
hope this willl solv ut problem
Amit -
Dear all,
I have data as char for example: 3,52 as char, when i try to transform data directly into key figure as number dec, it gives error message saying: it can not be interpreted as number..
Is there any easy way to convert data into number?
thanksHello John,
First, I would try to replace comma sign in your char into dot, in abap routine, using REPLACE statement. According to what you wrote - 3.52 it returns 3,52 ok - it could work. After that, you can use formula to change it into number, if needed.
Regards,
Peter
Maybe you are looking for
-
Doamin user password reset procedure failed on Weblogic 11g
Hi, I have lost my admin console password for weblogic11g server. I have followed the below steps to reset the password. 1). Created an initialization file using command java weblogic.security.utils.AdminAccount weblogic welcome1 . 2). Moved the file
-
Java Update - After deployed install and settings
Hi there, In our managed Windows 2000 environment with Windows XP Pro clienst (SP2) we use Active directory to deploy software packages. We are currently trying to install J2SE Runtime Environment 5.0 Update 5, which works perfectly. We have made a t
-
Hi am getting the following error while server startup for CRS application, please help me out. All the files are OOTB, i didnt made any changes to the files. 2011-08-05 15:07:34,152 ERROR [nucleusNamespace.atg.dynamo.messaging.MessagingManager] (Inp
-
USB media docking station won't wake up pc
using the USB media docking station with Toshiba Satellite laptop. If it goes into sleep mode for more than an hour, I need to open the laptop lid in order to wake up the PC. With my old HP laptop, I could simply move my external mouse or press any k
-
Photoshop document is RBG/8/CMYK.. hows that possible?
Looking at the photoshop document bar, it sais: untitled.psd @ 100% (Layer 1, RGB/8/CMYK) HOW could it be both cmyk and rgb?