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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:08:46+00:00 2026-06-12T17:08:46+00:00

I have a problem with the jqgrid Date formatter. in my DB table i

  • 0

I have a problem with the jqgrid Date formatter.
in my DB table i have this dateformat “Ymd” like “20120219”.
Here the whole code for this column:

$col = array();
$col["title"] = "Date";
$col["name"] = "date_dem";
$col["width"] = "40";
$col["editable"] = false;
$col["editoptions"] = array("size"=>20);
$col["formatter"] = "date"; // format as date
$col["formatoptions"] = array("srcformat"=>'Ymd',"newformat"=>'d/m/Y');
$cols[] = $col;

When i use this code i get for every record the same output: “01/01/1970”.
Anybody knows this problem?

THX in advanced

  • 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-12T17:08:48+00:00Added an answer on June 12, 2026 at 5:08 pm

    Even if the information about the date are saved as Ymd without any separators you have to return from the server the information with some separator between year, month and day. The problem is that the current code of jqGrid first split the input date using '\', '/', ':', '_', ';', '.' or ',' as separator (see the line of code)

    date = String(date).split(/[\\\/:_;.,\t\T\s-]/);
    

    and then use the srcformat to decode it. So you can’t use formatter: "date" to decode the date like 20121009. I recommend you to convert 20121009 to 2012-10-09 on the server side and return from the server the date always in ISO 8601 format which is defalt format used by jqGrid. Alternatively you can use custom formatter to display the date.

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

Sidebar

Related Questions

I have a jqGrid table, the same one from this problem , which I
i have this problem that i can't solve for days now...here is my code.
I have this mysql tables I want to display with jqgrid. The problem appears
i have this code and i have a little problem, when i edit, i
I have a problem with my jqGrid. I have seen other posts here with
I have this code just to send data from already loaded jqGrid: jQuery(#bedata).click(function(){ //Function
i have a problem in my jqgrid table: i load the json, i have
I have a few events set up like this: $('#grid').jqGrid('saveRow', lastsel, { aftersavefunc: function
Greetings, I have a problem using jqgrid and jquery tab (I am coding in
I'm using jqGrid and I have a problem getting Dynamic Linq to work. I

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.