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 6363087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:59:30+00:00 2026-05-24T23:59:30+00:00

I am using this to read over a list of HTML items. while (postIt.hasNext())

  • 0

I am using this to read over a list of HTML items.

while (postIt.hasNext()) {
    Element name = postIt.next();
    nameOf = name.text();

    String platform = postIt.next().text();

    //Get the URL
    Element url = name.select("a").first();
    urlString = url.attr("href");

    //Get the Genre of the item
    String genre = postIt.next().text();

    //Get the date
    Date = postIt.next().text();
}

What i would like to do is compare the Date String to that of the current date on the android device?
How would i go about doing this via Calendar?

  • 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-05-24T23:59:30+00:00Added an answer on May 24, 2026 at 11:59 pm

    I would do this using Date and SimpleDateFormat

    Date d = new Date(); //todays date (current time)
    
    //set the pattern here to look like the pattern you are expecting in your 'Date' variable
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    
    String formattedDate = sdf.format(d);
    //for today the string would look like this: "2011-08-26"
    
    boolean isToday = formattedDate.equals(Date); //your answer...
    

    If you are unfamiliar with SimpleDateFormatter, check out the documentation here. It has a lot of helpful information for setting up your pattern.

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

Sidebar

Related Questions

I recently read this thread on MSDN . So I was thinking of using
First let me say I have read this useful article thoroughly and am using
I am using WMI to query some properties disk drive. Does WMI read this
How is SAML SSO typically implemented? I've read this (n.b. obsolete) about using SAML
I read at Scottgu blog about using OutputCache for a function but this didn't
I am using VFPOLEDB driver to read DBF files and I keep getting this
I'm having problems reading this one JPEG file using ImageIO.read(File file) - it throws
When using memory-mapped files it seems it is either read-only, or write-only. By this
I am using this code to generate random text : from collections import defaultdict,
I'm new to MVC, but I've been all over this, read all the documentation

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.