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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:25:44+00:00 2026-06-12T22:25:44+00:00

So as the title says, I keep losing a day as I go from

  • 0

So as the title says, I keep losing a day as I go from mysql to my javascript and I cant figure it out. You lose a day when you insert into the data base (let’s say I put 10/14/12 the database will read 10/13/12) and I also lose a day when I read from the database (I fetch the 10/13/12 and it now reads 10/12/12).

Here is my process:

//date input from jquery ui datepicker       
$('#datepicker'+p).datepicker({numberOfMonths: 3, showButtonPanel: true, dateFormat: "D, d M, yy"});

//date sent to php to upload to mysql so there is a format conversion
$start = date("Y-m-d", strtotime($startdate));

Now on to downloading:

 //date taken from mysql no modifications

//date modified to be sent to viewer in a nicer format
var start = $.datepicker.formatDate('D, d M, yy', new Date (item.start));

What I think: the issue seems to happen both ways and I am pretty sure my javascript is not the issue and because there is only php conversion one way that seems to rule out both. Could this be an issue with my mysql server? ALSO NOTE that the dates are saved in mysql as type DATE!

//as requested my sql code
 INSERT INTO classdates (start, end, hours, days, off, notes, type, branch) VALUES(:start, :end, :hours, :days, :off, :notes, :type, :branch)
  • 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-12T22:25:45+00:00Added an answer on June 12, 2026 at 10:25 pm

    I figured out my issue was the javascript new Date() function. It is not just converting the date but also manipulating it. I had to accommodate for the timezone change.

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

Sidebar

Related Questions

As the title says, keep getting this error when trying to compile. From Googling
So as the title says i want to prevent user from keep submiting $_POST
Title says all. Sample code: ArrayList<HashMap<String, Object>> data = new ArrayList<HashMap<String, Object>>(); HashMap<String, Object>
as the title says, I keep getting undefined when I try to get the
As the title says it, I have a huge xml file (GBs) <root> <keep>
The title says everything. I don't understand: why you shouldn't keep your salt a
like the title says, I want to keep my logic in a separate project
As the title says: I try to merge the contents of 2 cells into
As title says, how do I call a java class method from a jsp,
As the title says, is there a way to remove code from a view

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.