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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:36:03+00:00 2026-05-23T03:36:03+00:00

Within my CodeIgniter app, I’m using a Jquery calendar pop-up that also captures time

  • 0

Within my CodeIgniter app, I’m using a Jquery calendar pop-up that also captures time as set by the user, so the end result looks like: MM-DD-YYYY HH:MM, and I’m storing this in MySQL into a DateTime field that is: YYYY-MM-DD HH:MM:SS. What is the best (most efficient) way to push the date/time into MySQL so that it saves properly, and to pull is back out of MySQL and render it on the screen in the reverse format? Thanks!

  • 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-23T03:36:04+00:00Added an answer on May 23, 2026 at 3:36 am

    Most efficient way is to use the ISO 8601 standard to pass date values between the client and server. Since the client and server talks in strings you’d be parsing the date to a string before sending it either way. The best format I prefer is the combined date and time in UTC:

    2011-06-14T13:57Z

    There are no spaces and it’s clean. Then you’ll have to parse it on the server side (should be relatively easy using PHP) and parse it on the client side.

    For displaying purposes, I prefer to extend JavaScript’s Date.prototype to include a format function that imitates PHP’s date format.

    Once you include the linked script from above you could do this on the server side –

    var today = new Date();
    alert(today.format('m-d-Y H:i')); //displays "06-14-2011 11:18"
    

    Good luck!

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

Sidebar

Related Questions

It used to be that within a CodeIgniter model you couldn't access another model.
Within an n-tier app that makes use of a WCF service to interact with
I am using the default Codeigniter page cache e.g.: $this->output->cache(n); My problem is that
I have a view that generates a dynamic navigation bar. Within Codeigniter, I just
I am using codeigniter 1.7.3 and I have controllers set up and working, but
I'm using this library for Facebook graph API access within my codeigniter project: http://www.haughin.com/code/facebook/
Im using CodeIgniter 2.0.2 and I noticed while calling a Model from within a
I am using codeigniter and when I set up the website I added necessary
I'm thinking about using CodeIgniter for a new project. I was reading the user-guide
How can I retrieve the current date and time within a view in Codeigniter?

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.