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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:02:50+00:00 2026-05-30T03:02:50+00:00

I am building an App that fetches all entries a user has made this

  • 0

I am building an App that fetches all entries a user has made “this week” (in their timezone). I store all entry times in the database as UTC/GMT time using:

gmdate('U')

My problem arises when I need to fetch “this week” in their timezone. Before i took timezones into account i used…

$startWeek = strtotime('monday this week 00:00')
$endWeek = strtotime('sunday this week 00:00')

…and used a SQL statement that searched BETWEEN those two variables.

The problem is, those two variables are using the server times, so it gives the servers start and end of the week.

I have access to the users timezone (ie: Australia/Melbourne) in a cookie if needed.

Bottom line, how do I fetch the beginning and end of the week, in timestamp format, in the timezone i have stored in a cookie?

  • 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-30T03:02:51+00:00Added an answer on May 30, 2026 at 3:02 am

    I think date_default_timezone_set function fits your requirement:

    http://www.php.net/manual/en/function.date-default-timezone-set.php

    You need to get the timezone from the user and then call the function with it. Going from the timezone, the following snippet should work:

    date_default_timezone_set('Melbourne/Australia');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently building an app that will parse all of the Audit entries in
Im building an app that requires the user to login with and ID and
I am currently building an app that has 6 images on the main view
Im building an app that takes a photo of the user, its working fine
Im building an app that allows the user to record a video (in app)
I'm building an app that begins by loading a 'downloading' view controller which fetches
This is the case I am building app that will be localized via strings
I'm building an app that will allow the user to send a status update
I am building an app that starts when a user takes a picture using
When building an app that is using sqlalchemy I get this error: creating python

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.