Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9226519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:51:05+00:00 2026-06-18T04:51:05+00:00

Following code is working fine in my java application. But when I am making

  • 0

Following code is working fine in my java application. But when I am making the same application for Android using java it’s showing error “The constructor Timestamp(long) is undefined” in the following bold line “Timestamp rtnTS = new Timestamp(theDate.getTime());“

public static Timestamp createTimeStamp(String strTime, String strFormat) throws Exception
{
    strTime = strTime.trim();

    SimpleDateFormat formatter = new SimpleDateFormat(strFormat);
    java.util.Date theDate = new java.util.Date();
    theDate = (java.util.Date) formatter.parse(strTime);
    **Timestamp rtnTS = new Timestamp(theDate.getTime());**
    return rtnTS;
}

Anyone please help to sortout this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:51:06+00:00Added an answer on June 18, 2026 at 4:51 am

    Have you imported these.

    import java.sql.Timestamp;
    import java.util.Date;
    

    Use like this.

    import java.sql.Timestamp;
    import java.util.Date;
    
    public class GetCurrentTimeStamp 
    {
        public static void main( String[] args )
        {
           java.util.Date date= new java.util.Date();
           Log.v("Time",new Timestamp(date.getTime()));
        }
    }
    

    Read from here http://developer.android.com/reference/java/sql/Timestamp.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'using the following code to create thumbnails using ffmpeg but it was working fine
The following code is working fine in Android 1.5-2.2.1 but it's not in 2.3
I have an Android application (java) that was working fine when compiled with the
I have the following code which is working fine , but can anybody tell
I have the following code that is working fine in jsfiddle - http://jsfiddle.net/darkajax/FHZBy/ I've
I have following code And it is working fine in AIR device simulator on
The following code is working great in a normal console application: private void button1_Click(object
I am using the following code for my form validation. The code is working
I have a Guice enabled application working fine, but when I optimize it (i.e.,
I am using following code snippet for getting factory instance of specified algorithm. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.