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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:55:47+00:00 2026-05-27T21:55:47+00:00

I work on a graph where I visualize my emails. I want to be

  • 0

I work on a graph where I visualize my emails. I want to be able to get the emails from a certain day.

Is this a bad way to store?

HashMap<DateTime, ArrayList<Email>>

Or is it better to convert the date to a string and then use HashMap<String, ArrayList<Email>>

Note, the dates are added without hours, minutes and seconds, so just like 06/07/2010 for example.

  • 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-27T21:55:47+00:00Added an answer on May 27, 2026 at 9:55 pm

    DateTime has properly defined equals and hashcode methods, so using those as the key in a HashMap is perfectly OK. There’s not much to be gained by converting them to strings first.

    I would suggest, however, that if you only want to store the year/month/day components, then you may want to use LocalDate instead of DateTime.

    Additionally, you could also consider using TreeMap rather than HashMap, so that your map is automatically sorted by date. Might be handy.

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

Sidebar

Related Questions

I've encountered several issues while trying to get Facebook's Graph API work in IE.
During my day-to-day work, I tend to come across data that I want to
Given this dependency graph: What's a good approach to iterate through it from bottom
I can't seem to get the Facebook Graph API to work in IE7, IE8,
At work we want our next generation product to be based on a graph
work on SQL Server 2000. want to Automated Email Notifications using SQL Server Job
Work on this small test application to learn threading/locking. I have the following code,
I work in VBA, and want to parse a string eg <PointN xsi:type='typens:PointN' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
I am using facebook graph. I am able to retrieve the access_token. Now I
Question in nutshell What is the best way to get Python and Java to

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.