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

  • Home
  • SEARCH
  • 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 7859671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:58:47+00:00 2026-06-02T21:58:47+00:00

I am storing some days and hours as timestamp in my MySQL table. What

  • 0

I am storing some days and hours as timestamp in my MySQL table. What I want to do now is retrieve every day that a specific user worked from last Sunday until the Sunday before (One week of work). And the other option is retrieve every day from today until last Sunday (current week). Some employees does not work everyday.

I don’t know how I can code this in Java or whether there is a specific MySQL function.

  • 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-02T21:58:49+00:00Added an answer on June 2, 2026 at 9:58 pm

    in Java, you can put the Calendar class to good use to find the previous Sunday :

    Calendar c = Calendar;
    c.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
    Date lastSunday = c.getTime();

    you can then decrement by 1 WEEK_OF_MONTH to find the Sunday before that :

    c.add(Calendar.WEEK_OF_MONTH, -1);
    Date sundayBeforeThat = c.getTime();

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

Sidebar

Related Questions

My application is storing some data in SQL Table called Transactions. Users are able
I'm considering storing some date values as ints. i.e 201003150900 Excepting the fact that
I want to build a security related application. I would be storing some important
I am storing and editing some field in a database that involves a long
I have date in this format 1999-05-31T13:20:00.000-05:00 I want to add some hours or
I've been hacking at a problem on and off for several days now that
I searches for hours (or days) and didn't find a solution yet. I want
I need to perform some calculations on times of days in 24 hours formatting
Currently I am storing some mp3 files locally on a simulator using the following
Imagine a web-application storing some data-resource with some id which stores three attachment (e.g.

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.