java conversion

java conversion

how do i convert String date="Aug 31, 2012 19:23:17.907339000 IST" to long value

View Answers

October 31, 2012 at 11:32 AM

Here is a code that converts string date to long.

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ConvertStringDateToLong {
  public static void main(String[] args) throws Exception {
    String today = "Aug 31, 2012 19:23:17.907339000 IST";

    DateFormat formatter = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss.S z");
    Date date = formatter.parse(today);
    long dateInLong = date.getTime();

    System.out.println("date = " + date);
    System.out.println("dateInLong = " + dateInLong);
  }
}

October 31, 2012 at 7:17 PM

Thank you for your post. The output dateInLong gives millisecond but i want nanosecond long value for the exact date "Aug 31, 2012 19:23:17.907339000 IST" how can i do..?









Related Tutorials/Questions & Answers:
java conversion
java conversion  how do i convert String date="Aug 31, 2012 19:23:17.907339000 IST" to long value
object conversion - Java Beginners
/java-conversion/ObjectToDouble.shtml Thanks... sandeep kumar suman...object conversion   Hi, Can anybody tell me the object conversion in java.   Hi sandeep Can u please tell me in details about your
Advertisements
Java Conversion Question - Java Beginners
Java Conversion Question   Hello sir ,How i can Convert Java Code to Vb.net ,Plz Help Me
Type Conversion - Java Beginners
for conversion
hexadecimal conversion java compilation - UML
hexadecimal conversion java compilation  write a simple program..., Please visit the following links: http://www.roseindia.net/java/java-conversion/BinaryToHexa.shtml http://www.roseindia.net/java/java-conversion
Distance conversion - Java Beginners
Distance conversion  Write an application that reads a distance in metres. The program will then present a user menu of conversion types, converting the distance to kilometres, feet and inches, according to the user?s selection
form to java script conversion
form to java script conversion  I am using a form one more form cotain a piece of code . how to convert it to java script to function it properly..." name="ie" value="UTF-8" /> <input type="text" name="q" size="55" />
Excel conversion tool. - Java Beginners
Excel conversion tool.  Hi, I need a conversion tool which can convert .xls(Excel 2003) to .xlsx (Excel 2007) and vice-versa. Please suggest any links ro tools. Thank You
String to Date Conversion - Java Beginners
)); For read more information : http://www.roseindia.net/java/java-conversion...  Hi friend, For conversion in this format : 11/SEP/2008 07:07:32
Another distance conversion - Java Beginners
a method for each conversion ? toKilometres(), toFeet(), and toInches
Conversion In Collections - Java Interview Questions
Conversion In Collections  Hi Friends, can u give code to convert ArrayList to HashMap and HashMap to ArrayList. Thanks Prakash  Hi Friend, 1)Convert ArrayList To HashMap: import java.io.*; import java.util.
Java To Vb.Net Conversion - Java Beginners
Java To Vb.Net Conversion  How to convert Java Code To VB.net,which Software is useful to convert java to vb.net,plz Help Me
PDF to Word Conversion - Java Beginners
PDF to Word Conversion  Hello, Can we convert a PDF document to Microsoft word document thru Java. If its not possible in Java, is it possible in any other language
Java Date conversion - Date Calendar
Java Date conversion  How do I convert 'Mon Mar 28 00:00:00 IST 1983' which is a java.util.Date or String to yyyy/MM/dd date format in sql
Conversion from color to Gray Image - Java Beginners
Conversion from color to Gray Image  Hi... Sakthi here.. i am new to java. and i haven't try this so far How to convert the color image to gray scale image in java? could u plz help me out to start the process
java code for conversion of arraylist to string - Development process
java code for conversion of arraylist to string  Hi, i have an arraylist contains [a,b,value,c,d,value]when ever value comes it will split into seperation.fo that i want to convert into string, after that split the string
image conversion tools
image conversion tools  how many tools are available in image conversion at particularlly in java
Java Date Conversion
Java Date Conversion In java date conversion, two packages are used... seconds and even then only Java provides implementation that actually track leap... Java Converts String into Date In this example we are going to convert
conversion Applet
conversion Applet  I am a java beginner.................. strong texthow to create JApplet that prompts the user to enter a distance in miles in a JTextField and then converts mile to kilometers and display the result as XX.XX
Java code for conversion between .xls and .xlsx or vice versa - Development process
Java code for conversion between .xls and .xlsx or vice versa  I've some problems in my Project. I'm working on a web based application which... or tool in Java for converting between .xls to .xlsx or Vice versa
Maven dependency for cn.featherfly - featherfly-conversion version 1.4.2 is released. Learn to use featherfly-conversion version 1.4.2 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.4.2 in Java... and includes  cn.featherfly - featherfly-conversion version 1.4.2 java...-conversion released The developers of   cn.featherfly - featherfly
Maven dependency for cn.featherfly - featherfly-conversion version 1.4.2 is released. Learn to use featherfly-conversion version 1.4.2 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.4.2 in Java... and includes  cn.featherfly - featherfly-conversion version 1.4.2 java...-conversion released The developers of   cn.featherfly - featherfly
Maven dependency for cn.featherfly - featherfly-conversion version 1.4.2 is released. Learn to use featherfly-conversion version 1.4.2 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.4.2 in Java...-conversion released The developers of   cn.featherfly - featherfly-conversion project have released the latest version of this library on 06 Apr 2022
Maven dependency for cn.featherfly - featherfly-conversion version 1.2.0 is released. Learn to use featherfly-conversion version 1.2.0 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.2.0 in Java...-conversion released The developers of   cn.featherfly - featherfly-conversion project have released the latest version of this library on 26 Apr 2016
Maven dependency for cn.featherfly - featherfly-conversion version 1.2.1 is released. Learn to use featherfly-conversion version 1.2.1 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.2.1 in Java...-conversion released The developers of   cn.featherfly - featherfly-conversion project have released the latest version of this library on 12 Apr 2017
Maven dependency for cn.featherfly - featherfly-conversion version 1.2.2 is released. Learn to use featherfly-conversion version 1.2.2 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.2.2 in Java...-conversion released The developers of   cn.featherfly - featherfly-conversion project have released the latest version of this library on 13 Apr 2017
Maven dependency for cn.featherfly - featherfly-conversion version 1.3.0 is released. Learn to use featherfly-conversion version 1.3.0 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.3.0 in Java...-conversion released The developers of   cn.featherfly - featherfly-conversion project have released the latest version of this library on 20 Aug 2019
Maven dependency for cn.featherfly - featherfly-conversion version 1.3.1 is released. Learn to use featherfly-conversion version 1.3.1 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.3.1 in Java...-conversion released The developers of   cn.featherfly - featherfly-conversion project have released the latest version of this library on 26 Aug 2019
Maven dependency for cn.featherfly - featherfly-conversion version 1.3.2 is released. Learn to use featherfly-conversion version 1.3.2 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.3.2 in Java...-conversion released The developers of   cn.featherfly - featherfly-conversion project have released the latest version of this library on 29 Aug 2019
Maven dependency for cn.featherfly - featherfly-conversion version 1.3.3 is released. Learn to use featherfly-conversion version 1.3.3 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.3.3 in Java...-conversion released The developers of   cn.featherfly - featherfly-conversion project have released the latest version of this library on 03 Dec 2019
Maven dependency for cn.featherfly - featherfly-conversion version 1.3.4 is released. Learn to use featherfly-conversion version 1.3.4 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.3.4 in Java...-conversion released The developers of   cn.featherfly - featherfly-conversion project have released the latest version of this library on 03 Dec 2019
Maven dependency for cn.featherfly - featherfly-conversion version 1.4.3 is released. Learn to use featherfly-conversion version 1.4.3 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.4.3 in Java...-conversion released The developers of   cn.featherfly - featherfly-conversion project have released the latest version of this library on 09 Dec 2022
Maven dependency for cn.featherfly - featherfly-conversion version 1.4.1 is released. Learn to use featherfly-conversion version 1.4.1 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.4.1 in Java...-conversion released The developers of   cn.featherfly - featherfly-conversion project have released the latest version of this library on 01 Dec 2020
Maven dependency for cn.featherfly - featherfly-conversion version 1.4.0 is released. Learn to use featherfly-conversion version 1.4.0 in Maven based Java projects
? Steps to use  cn.featherfly - featherfly-conversion version 1.4.0 in Java...-conversion released The developers of   cn.featherfly - featherfly-conversion project have released the latest version of this library on 11 Apr 2020
currency conversion
currency conversion   hi frds.. I wan jsp code to convert currency in different formats??... if u know plz plz plz post it   Please visit the following link: http://www.roseindia.net/tutorials/I18N/currency
conversion - Java Beginners
conversion
conversion
Conversion - Development process
Conversion  Why is there a need to convert from Java to .NET? What is the theory of conversion from java to .NET? How it is done?   Hi... Conversion Assistant (JLCA). Code that calls Java APIs can convert to comparable C# code
html2xml conversion
html2xml conversion  java code to convert html file to xml
Language Conversion
Language Conversion  write a java program to convert "Hello World" in spanish
ModuleNotFoundError: No module named 'conversion'
ModuleNotFoundError: No module named 'conversion'  Hi, My Python... 'conversion' How to remove the ModuleNotFoundError: No module named 'conversion' error? Thanks   Hi, In your python environment you
conversion of language in a project
conversion of language in a project  how can we convert the database code in the project dynamically
Number conversion in JavaScript
Number conversion in JavaScript  How do you convert numbers between different bases in JavaScript
.wav file conversion
.wav file conversion   how to read .wav file and converd the data into text format
NSString to float conversion
NSString to float conversion  HI, I my iPhone and iPad application I have to convert NSString to float. Provide me example of NSString to float conversion. Thanks   Hi, Please see NSString to float conversion
Maven, Gradle, SBT, Ivy, Grape, Leiningen and Buildr Dependency for featherfly-conversion version 1.3.4
-conversion version 1.3.4. You can add these depency in your project to get cn.featherfly:featherfly-conversion:1.3.4 Java library in your project.. Maven...-conversion version 1.3.4 In this section have given the dependency code
Maven, Gradle, SBT, Ivy, Grape, Leiningen and Buildr Dependency for groupdocs-conversion version 17.3.0
-conversion version 17.3.0. You can add these depency in your project to get com.groupdocs:groupdocs-conversion:17.3.0 Java library in your project.. Maven...-conversion version 17.3.0 In this section have given the dependency code
Maven, Gradle, SBT, Ivy, Grape, Leiningen and Buildr Dependency for groupdocs-conversion version 16.10.1
-conversion version 16.10.1. You can add these depency in your project to get com.groupdocs:groupdocs-conversion:16.10.1 Java library in your project.. Maven...-conversion version 16.10.1 In this section have given the dependency code
Maven, Gradle, SBT, Ivy, Grape, Leiningen and Buildr Dependency for groupdocs-conversion version 3.0.0
-conversion version 3.0.0. You can add these depency in your project to get com.groupdocs:groupdocs-conversion:3.0.0 Java library in your project.. Maven...-conversion version 3.0.0 In this section have given the dependency code for Maven

Ads